US president Barack Obama has urged European allies to match his decision to send 250 more American troops to Syria as he stressed the need to keep up "momentum" in the campaign against Islamic State (IS) extremists.

US president Barack Obama has urged European allies to match his decision to send 250 more American troops to Syria as he stressed the need to keep up "momentum" in the campaign against Islamic State (IS) extremists.

Mr Obama's announcement of the deployment capped a six-day tour to the Middle East and Europe, and reflected a deepening of US military engagement, despite the outgoing president's professed reluctance to dive further into another conflict in the Middle East.

Mr Obama said he wanted the US to share the increasing security burden. He discussed the IS fight with Prime Minster David Cameron, German chancellor Angela Merkel, French president Francois Hollande and Italian prime minster Matteo Renzi.

The American leader formally announced the new troop deployment in a speech about European unity and trans-Atlantic cooperation - a running theme of his trip.

Speaking in Hanover, Germany, he evoked the continent's history of banding together to defeat prejudice and to emerge from the "ruins of the Second World War".

"Make no mistake," Mr Obama said. "These terrorists will learn the same lessons as others before them have, which is: your hatred is no match for our nations united in the defence of our way of life."

The rhetoric belied an underlying frustration in his administration about allies' contributions to the US-led fight in Syria and neighbouring Iraq.

A lthough the coalition includes some 66 nations, the US has conducted the vast majority of the air strikes, and there has been little appetite by other nations to send in ground troops of their own.

The US president recently stung leaders in Europe and the Middle East by describing allies as "free riders".

He made a passing reference to that complaint on Monday, as he noted that not all European allies contribute their expected share to Nato: "I'll be honest: sometimes Europe has been complacent about its own defence."

On stops in Riyadh, London and Hanover this week, Mr Obama repeatedly pushed allies for more firepower, as well as training for local forces and economic aid to help reconstruct regions in Iraq that have been retaken from IS control, but are still vulnerable.

Mr Obama appeared to come up short in Riyadh, when he met with Arab allies.

He made the pitch again in Hanover, where he attended a massive industrial technology trade show on what was likely his last presidential visit to Germany.

"These terrorists are doing everything in their power to strike our cities and kill our citizens, so we need to do everything in our power to stop them," Mr Obama said.

The new deployment brings the number of US military personnel in Syria from roughly 50 to roughly 300.

It follows a similar ramp-up in Iraq, announced last week. The new Syria forces will include special operations troops assisting local forces, as well as maintenance and logistics personnel.

Mr Obama, in an interview with CBS News, declined to say whether the forces might be dispatched on search-and-kill missions.

He did say: "As a general rule, the rule is not to engage directly with the enemy but rather to work with local forces."

Mr Obama's troop announcement was called "a good step" by Salem Al Meslet, spokesman of the High Negotiations Committee, the main Syrian opposition group.

Senator John McCain said it was "a welcome development, but one that is long overdue and ultimately insufficient".

Mr Obama's call for European solidarity extended beyond the anti-IS campaign. As well as arguing that Britain should remain in the EU, he mounted a forceful defence of his host in Germany, chancellor Angela Merkel, who is facing criticism for her willingness to take in refugees from Syria.

"Chancellor Merkel and others have eloquently reminded us that we cannot turn our backs on our fellow human beings who are here now and need our help now," Mr Obama said.

"We have to uphold our values, not just when it's easy but when it's hard."

The migrant crisis was a central focus as Mr Obama met with European leaders just before returning to Washington.

Mrs Merkel said the leaders had discussed ways to expand military efforts to stop human smuggling across the Mediterranean from Libya.

"With the Nato mission in the Aegean, the United States of America have shown their readiness to take part in the fight against illegal migration," Mrs Merkel said.

A senior US official said America was indeed ready to help with that effort but had no new mission to announce.

Mr Obama, who used one of his final foreign trips to start trying to shape his legacy, said he saw Europe facing a "defining moment".

He urged the continent's leaders to pay attention to income inequality, education for young people and equal pay for women.

"If we do not solve these problems, we start seeing those who would try to exploit these fears and frustrations and channel them in a destructive way," Mr Obama said.