Seeking to unwind the most serious cross-border escalation in its 18-month-old crackdown on dissent, Damascus apologised through the United Nations for shelling which killed five civilians in southeast Turkey on Wednesday and said it would not happen again, Turkey's Deputy Prime Minister Besir Atalay said.
Syria's staunch ally Russia said it had received assurances from Damascus that the mortar strike had been a tragic accident.
But Turkey's government said "aggressive action" against its territory by Syria's military had become a serious threat to its national security and parliament approved the deployment of Turkish troops beyond its borders if needed.
"Turkey has no interest in a war with Syria. But Turkey is capable of protecting its borders and will retaliate when necessary," Ibrahim Kalin, a senior adviser to Prime Minister Tayyip Erdogan, said on his Twitter account.
"Political, diplomatic initiatives will continue," he said.
At the United Nations, Russia blocked the adoption of a draft statement condemning the Syrian shelling of Akcakale and proposed a weaker text that would call for "restraint" on the border without referring to breaches of international law.
Western diplomats complained that Russia's proposals, if accepted, would weaken the statement to an unacceptable degree.
U.N. Secretary-General Ban Ki-moon was "alarmed by escalating tensions" between Syria and Turkey and warned that the risk of the 18-month-long Syrian conflict embroiling the entire region was growing, his spokesman said.
China's Foreign Ministry urged Turkey and Syria to exercise restraint.
The peaceful pro-democracy movement which surfaced in March 2011 in Syria turned into a full-scale armed revolt after President Bashar al-Assad tried to crush it and is now becoming a sectarian conflict that could destablise neighbouring states.
Turkey hit back after what it characterised as "the last straw" when the mortar hit Akcakale, killing a mother, her three children and a female relative.
Atalay said Turkey had exercised its right to retaliation and that parliament's authorisation for a foreign military deployment was not a "war memorandum".
"It's a deterrent measure taken in line with Turkey's interests, for use when it needs to protect itself," he told reporters.
Three armoured personnel carriers were positioned on the southern edge of Akcakale, their guns trained on the Syrian town of Tel Abyad a few miles (kms) across the frontier. The Syrian Observatory for Human Rights said three Syrian soldiers were killed by Turkish shelling of a military post nearby.
Syrian state media has not reported any casualties.
The observatory also reported clashes between Syrian rebels and the Syrian army at the military post, and said the rebels had killed 21 elite Republican Guards on Thursday in an ambush on an army minibus in a suburb northwest of Damascus.
AGGRESSIVE ACTION
The southern edge of Akcakale, right on the border, resembles a ghost town. Houses stand empty and shops are shuttered. Much of the population is ethnically Arab and many men walk around in the traditional Arab jalabiyya and red and white headscarves.
"Everyone is gone, look around," said Ibrahim Cilden, 33, who lives only a few houses away from the one which was hit on Wednesday. A new camp for Syrian refugees sits on the edge of the town but nobody has yet moved in.
"Where have they built it? Right at the exit to our town. So the Syrians fire mortars at us. We act like a magnet," he said.
Turkey's parliament already had been due to vote on Thursday on extending a five-year-old authorisation for foreign military operations, an agreement originally intended to allow strikes on Kurdish militant bases in northern Iraq.
But the memorandum signed by Erdogan and sent for parliamentary approval also said that despite repeated warnings and diplomatic initiatives, the Syrian military had launched aggressive action against Turkish territory, presenting a "serious threat".
"At this point the need has emerged to take the necessary measures to act promptly and swiftly against additional risks and threats," it said.
Police fired teargas to stop a group of around 25-30 anti-war protesters chanting "We don't want war!" and "The Syrian people are our brothers!" from approaching parliament as deputies debated the motion.
In Istanbul, around 5,000 people joined an anti-war protest, which also turned into a demonstration against Turkey's ruling AK Party on Thursday evening.
"The AKP wants warn, the people want peace," "No to war, peace right now," the crowds chanted as riot police looked on.
It was not clear who fired the mortar into Turkey, but security sources said it had come from near Tel Abyad and that Turkey was increasing the number of troops along its border.
Syria said it was investigating the source of the mortar bomb and urged restraint. Information Minister Omran Zoabi said his country respected the sovereignty of neighbouring countries.
Russia said Damascus had vowed there would not be a repeat.
"We think it is of fundamental importance for Damascus to state that officially," RIA Novosti news agency quoted Russian Foreign Minister Sergei Lavrov as saying during a visit to Islamabad.
CONDEMNATION
Turkey's military response contrasted with its relative restraint when Syria shot down a Turkish reconnaissance jet in June. Ankara increased its military presence along its 900-km (560-mile) border with Syria and called a meeting of NATO's North Atlantic Council.
At the time, Erdogan warned any Syrian element approaching Turkey's border and deemed a threat would be treated as a military target.
World leaders condemned the mortar strike but urged restraint.
British Foreign Secretary William Hague told Reuters the Turkish response was "understandable" but warned against an escalation, while EU foreign policy chief Catherine Ashton called on Syria to respect the territorial integrity of its neighbours.
German Chancellor Angela Merkel condemned Syria's actions against Turkey and urged all involved to show "common sense".
NATO said it stood by member-nation Turkey and urged Syria to put an end to "flagrant violations of international law."
The U.S.-led Western military alliance held an urgent late night meeting in Brussels to discuss the matter and in New York, Turkey asked the U.N. Security Council to take the "necessary action" to stop Syrian aggression.
Some 30,000 people have been killed across Syria, activists say, in a conflict with growing sectarian overtones which threatens to draw in regional Sunni Muslim and Shi'ite powers.
Turkey is sheltering more than 90,000 refugees from Syria and fears a mass influx similar to the flight of half a million Iraqi Kurds into Turkey after the 1991 Gulf War.
Violence inside Syria intensified on Wednesday with three suicide car bombs and a mortar barrage ripping through a government-controlled district of Aleppo housing a military officers' club, killing 48 people, according to activists.