(CNN) -- U.S. President Barack Obama and his Russian counterpart, Vladimir Putin, held "constructive" talks Friday on Syria on the sidelines of the Group of 20 summit in Russia.
The two leaders hold opposing views on whether military action should be taken against the Syrian government over its alleged use of chemical weapons on its own people.
Obama is seeking to rally domestic and international support for military strikes on Syria, while Putin -- a determined ally of Syrian President Bashar al-Assad -- has challenged the assertion that regime forces were behind the attacks. Syria's government blames rebel forces.
Obama said the two leaders had a "candid, constructive" conversation but acknowledged that Putin was unlikely to shift his position on military action against Syria.
However, he said, they could both agree to work toward a political resolution to the crisis.
Putin gave a similar account of their meeting. "He doesn't agree with me, I don't agree with him. But we listened to each other," Putin told reporters.
He and Obama also talked about ways to solve the Syrian crisis peacefully, he said.
Obama said he believed the majority of the leaders at the G20 meeting were "comfortable with (the) conclusion that the Assad government was responsible" for the use of chemical weapons last month.
But, he said, divisions arose over whether military action against Syria must be authorized by the U.N. Security Council, where Russia has blocked action so far.
Obama said that because of Security Council "paralysis" on the issue, countries should be willing to act without the council's authorization.
"If we are serious about upholding a ban on chemical weapons use, then an international response is required, and that will not come through Security Council action."
But he said he was encouraged by the discussions about Syria in St. Petersburg. "There's a growing recognition that the world cannot stand idly by," Obama said.
The U.S. president showed emotion as he talked of the gassing of more than 1,400 people, 400 of them children.
"This is not something we fabricated, this is not something we are using as an excuse for military action. ... I was elected to end wars, not start them," he said. "But we have to make hard choices when we stand up for things we care about."
Putin said the leaders were split nearly "50-50" regarding whether to intervene militarily in Syria.
He stressed that action against Syria without U.N. Security Council approval would be illegal.
The Syrian government has said that opposition fighters launched the August 21 chemical attack on the outskirts of Damascus.