The UN Security Council has condemned a Syrian mortar attack on a Turkish border town that killed five civilians.
The statement said the attack underscored the grave impact the Syrian crisis was having on “regional peace and stability”.
An earlier draft referring to “international peace and security” was blocked by Syria’s ally Russia.
Turkey’s parliament has authorised military action inside Syria, a move that triggered anti-war protests.
However, Turkish Prime Minister Recep Tayyip Erdogan has said his country does not intend to start a war with Syria.
The BBC’s Barbara Plett at the UN says the statement was strongly worded but was still the result of a compromise with Russia, which has blocked previous resolutions condemning Damascus.
Russia had tried but failed to include language apparently aimed at balancing the Syrian attack with Turkey’s military response, she says.
But Russia did succeed in blocking a draft version that called the mortar attack “a threat to international peace and security”, a phrase our correspondent says could be used to justify greater Security Council involvement.
The final version said the incident “highlighted the grave impact the crisis in Syria has on the security of its neighbours and on regional peace and stability”.
It demanded that “such violations of international law stop immediately and are not repeated”.
It called on the Syrian government to “fully respect the sovereignty and territorial integrity of its neighbours” and urged “restraint”.
Syria’s UN envoy Bashar Jaafari said his government was not seeking escalation with Turkey.
He criticised the Security Council’s silence on “suicide terrorist attacks that struck the city of Aleppo” that killed dozens of Syrians on the same day as the Turkish incident.
A senior diplomat said the Security Council would address that issue on Friday.
On Thursday, Turkey’s parliament authorised troops to launch cross-border operations against Syria for a period of one year.
The emergency vote followed the shelling of the Turkish town of Akcakale in which two women and three children were killed.
Turkey’s immediate response was to shell targets inside Syria.
Mr Erdogan said at a news conference in Akcakale on Thursday evening: “We want peace and security and nothing else. We could never be interested in something like starting a war.”
But he added: “The Turkish Republic is a state capable of defending its citizens and borders. Nobody should try and test our determination on this subject.”
On Thursday evening thousands of people held an anti-war rally in Istanbul’s Taksim Square.
Demonstrators chanted: “No to war! Peace now! We won’t be soldiers of imperialists!”
Some banners accused Mr Erdogan’s Justice and Development Party (AKP) of being a stooge of the US.
Bedri Baykam, a Turkish artist and activist, said: “[The] United States wants Turkey to enter war against Syria because there are elections coming in the United States. Obama doesn’t want to send American troops so the Turkish army serves as their tool but we don’t want to be part of the bloodshed in the Middle East.”
Other, smaller anti-war protests were reported in Izmir, Mersin, Eskisehir and other cities and towns.
Mr Jaafari said his country had offered condolences over the deaths but not an apology because an inquiry into the incident had not been completed.
Turkey has been a critic of Syrian President Bashar al-Assad since anti-government protests erupted there more than a year ago.
Ankara has openly supported the armed rebellion and called for the end to the regime.