Turkey's parliament has authorised troops to launch cross-border action against Syria, following Syria's deadly shelling of a Turkish town.
The bill, passed by 320 to 129, also permits strikes against Syrian targets.
But Deputy Prime Minister Besir Atalay insisted this was a deterrent and not a mandate for war.
Turkey has been firing at targets inside Syria since Wednesday's shelling of the town of Akcakale, which killed two women and three children.
Ankara's military response marks the first time it has fired into Syria during the 18-month-long unrest there.
Syria's UN envoy said two Syrian army officials were injured in the retaliatory shelling.
The Turkish parliament passed the bill in a closed-doors emergency session.
It permits military action, if required by the government, for the period of one year.
However, Mr Atalay insisted the priority was to act in co-ordination with international bodies.
He told Turkish television: "This mandate is not a war mandate but it is in our hands to be used when need be in order to protect Turkey's own interests."
He said Syria had accepted responsibility for the deaths.
"The Syrian side has admitted what it did and apologised," Mr Atalay said.
Zeliha Timucin, her three daughters and her sister died in Akcakale when a shell fell in their courtyard as they prepared the evening meal.
They were buried in a local cemetery on Thursday.
Turkey had called for the UN Security Council to meet and take "necessary action" to stop Syrian "aggression".
However, Mr Atalay said that UN and Syrian representatives had spoken on Wednesday evening.
He said: "Syria... said nothing like this will happen again. That's good. The UN mediated and spoke to Syria."
UN Secretary General Ban Ki-moon was "alarmed by escalating tensions along the Syrian-Turkish border", according to his spokesman, Martin Nesirky, and has called for "maximum restraint".
"As the situation inside Syria deteriorates yet further... the risks of regional conflict and the threat to international peace and security are also increasing," Mr Nesirky said.
The UN Security Council drafted a resolution on Thursday condemning the Syrian shelling "in the strongest terms", calling it a "violation of international law".
However, Russia, Syria's main ally, has blocked the text and instead proposed one that does not refer to international law, and which calls on all parties to "exercise restraint".
Syria's UN envoy, Bashar Ja'afari, said his country had offered deepest condolences over the deaths, but not an apology, because an investigation into the incident had not been completed.
Nato has held an urgent meeting to support Turkey, demanding "the immediate cessation of such aggressive acts against an ally".
The US, the UK, France and the European Union have already condemned Syria's actions.
The BBC's Jim Muir in Beirut says neither Turkey nor Syria wants this to develop into a war. He says there is no appetite in Nato or the West for military conflict and that it is noticeable how conciliatory Syria has been since the news of the shelling broke.
Many social media users in Turkey have been reacting strongly against the possibility of war with Syria.
Hashtags such as #notowar drew a lot of attention.
One user, coymak, tweeted: "There is no victory in war, only victory is the happiness in the eye of the children when it is ended!"
There were many tweets referring to the call for an anti-war rally in central Istanbul on Thursday evening.
Reports later said many hundreds of people had gathered in the city's Taksim Square.
In Syria itself as many as 21 members of Syria's elite Republican Guards have been killed in an explosion and firefight in the Qudsaya district of Damascus, the UK-based Syrian Observatory for Human Rights (SOHR) told the BBC.
The SOHR is one of the most prominent organisations documenting and reporting incidents and casualties in the Syrian conflict. The group says its reports are impartial, though its information cannot be independently verified.