Germany's parliament has voted to send military support to the US-led coalition fighting Islamic State (IS) militants in Syria.
MPs approved the plan for a German non-combat role by 445 votes to 146.
Tornado reconnaissance jets, a naval frigate and 1,200 soldiers will be sent to the region.
The vote comes after a French request following last month's Paris attacks. Ministers believe Germany is now an IS target too.
Germany's decision comes a day after British warplanes carried out their first air strikes on IS targets in Syria after the country's parliament authorised the military operation.
Also on Friday, Turkey deployed "several hundred" soldiers to provide training to Iraqi troops near the IS-held Iraqi city of Mosul, a Turkish security source told Reuters.
The source said the troops had previously been in Iraqi Kurdistan and that coalition countries targeting Islamic State had been made aware of the move.
This will be Germany's biggest current military operation abroad.
The mandate will initially last a year and will cost €134m (£97m; $146m).
Chancellor Angela Merkel relied on MPs from her ruling Christian Democrat (CDU/CSU) and Social Democrat (SPD) coalition to back the motion for military involvement.
Germany's opposition Left party rejected the mission, while most of the parliament's Green MPs also voted no, according to reports.
Ahead of the vote, Green Party chairwoman Simone Peter expressed concern about the legal basis for the mission without a specific UN resolution authorising it.
But Justice Minister Heiko Maas told Tagesspiegel newspaper on Friday that he had no doubts about the legal legitimacy.
"We have to stop these terrorist murderers," he said. "We will not succeed in this by military means alone, but we will not succeed without it either."
After the Paris attacks last month the UN Security Council adopted a French resolution calling on UN member states to "take all necessary measures" to "prevent and suppress terrorist acts" committed by IS, al-Qaeda and affiliated "terrorist" groups.
France also invoked an EU Treaty clause on mutual defence - Article 42.7 - to get help from its EU partners in the fight against IS.
Nato's Secretary-General Jens Stoltenberg welcomed Western intervention - but stressed that Nato members should do more to train local fighters.
Speaking to BBC Radio 4's World at One, he said: "We have to do more in the whole region to build local capacity and we have to remember that this is not a fight between the West and the Arab or Muslim world.
"This is a fight against terrorists, criminal people who are attacking the core values of our societies."
He also called on Russia to focus its airstrikes on IS rather than on anti-Assad rebels.
The German army says forces will be deployed "in and over Syria where IS is operating, on the territory of states whose governments have given approval [to Germany], in the eastern Mediterranean, Gulf, Red Sea and adjoining seas".
Aside from aircraft, the naval frigate Sachsen will help support the French aircraft carrier Charles de Gaulle in the eastern Mediterranean.
Germany will boost to 150 its 100-strong contingent of troops in northern Iraq. They are helping to train Kurdish Peshmerga forces who are fighting IS. Germany is also providing arms and ammunition for them.
Germany's armed services association has cautioned against entering a conflict without clearly defined goals.
"I'm working on the basis that this fight, if it is taken seriously, will go on for well over 10 years," the association's chairman Andre Wuestner told German TV this week.
Until now, Germany's biggest foreign mission has been in Afghanistan, but that has gradually wound down to a force of just less than 1,000.