Pacific-rim nations closed ranks against terrorism on Thursday at the end of a summit that was darkened by last week's attacks in Paris, but still Washington and Moscow sparred over how to deal with Syria and the Islamic State fighters sheltering there.

The Asia-Pacific Economic Cooperation (APEC) group's 21 leaders vowed to prevent terrorism from undermining values that underpin their economies, and said there was a need for greater international cooperation to fight the scourge.

"Under the shadow cast by the terrorist attacks in Paris, Beirut, and against Russian aircraft over the Sinai, and

elsewhere, we strongly condemn all acts, methods, and practices of terrorism in all their forms and manifestations," they said in a declaration after their summit in Manila.

The mood was somber at the APEC summit after last Friday's killing spree by Islamic State fighters in Paris, where at least 129 people died, and this overshadowed the annual meeting's usual focus on growth, trade and development issues.

U.S. President Barack Obama said many nations have already been working together to defeat Islamic State, but it will be a multi-year task and only a political settlement in civil war-torn Syria will eliminate the group's safe havens there.

He said that a solution to Syria's turmoil could not include President Bashar al-Assad remaining in power "because the overwhelming majority of people in Syria consider him to be a brutal, murderous dictator", and he again took Russia to task for propping up the country's leader.

Russia began air strikes in Syria at the end of September. It has always said its main target is Islamic State militants, but most of its bombs in the past hit territory held by other groups opposed to its ally Assad.

However, Russia has unleashed intensified air strikes against Islamic State positions in Syria after investigators concluded that a terrorist bomb brought down a Russian airliner over Egypt last month. Islamic State has claimed the attack.

SOUTH CHINA SEA TENSION

Summit host, the Philippines, deliberately sought to keep at bay tensions between Beijing and Washington over the South China Sea even though it is one of the claimants to a strategic waterway where China has been building artificial islands.

But Obama kept the dispute in focus by pointedly visiting the Philippines' main warship in Manila, and one of his advisers said the United States and others would bring the issue up at an East Asia summit that will follow this weekend in Malaysia.

"We do want the East Asian summit to address maritime security issues," Asia policy adviser Daniel Kritenbrink said.

"When we see instances of powers that behave in ways that contravene those international rules and norms in the region we expect our partners and allies to stand with us and call out that behavior," he told reporters.

Obama will also "very directly" raise concerns with Malaysian Prime Minister Najib Razak in Kuala Lumpur about the status of the country's opposition, including the imprisonment of some, U.S. Deputy National Security Adviser Ben Rhodes said.

The summit discussed efforts to promote trade across their countries, spurred by a sag in economic growth across much of their region, which is home to 3 billion people and accounts for 60 percent of global output.

It was an opportunity for leaders of the 12-member Trans-Pacific Partnership (TPP) to meet for the first time since they sealed a deal to eliminate trade barriers and enable free trade.

However, the main concern among these 12 was whether the U.S. Congress would ratify the pact before Obama leaves office in just over a year from now.

China, which is not part of TPP, is pushing to begin talks on another trade pact, called the Regional Comprehensive Economic Partnership (RCEP) and wants to speed up talks on free trade agreements with Japan and South Korea.

As the leaders gathered for the customary annual group photograph, Philippine police used water canon to prevent hundreds of left-wing demonstrators from disrupting the summit. Twenty protesters and five police officers were injured.

"We are not for sale!" the protesters chanted about a kilometer (half a mile) from the convention center where the leaders were meeting. "Junk APEC!"

An excited crowd of another nature gathered around Canada's new prime minister, Justin Trudeau, whose winsome looks have made him a hot topic on social media in the Philippines.

"He held my hand!" shrieked one woman from a crowd of journalists and summit staff as police whisked him away.