
President Donald Trump participated Monday in the opening ceremonies of a 10-nation gathering in the Philippines, the final stop in his five-country Asia tour.

The Association for Southeast Asian Nations conference in Manila opened with a bass-thumping, pageantry-rich ceremony that included an unusual group photo of world leaders.

Instead of standing on risers, heads of state lined up for a traditional cross-body handshake, which appeared to baffle Trump until he figured out what to do with his arms.

'Give us your brightest smile,' a master of ceremonies intoned as camera flashes popped. 'It's the ASEAN handshake: right hand over left.'

Trump gamely played along and laughed at the silliness of the situation, but ultimately he got it right – unlike Russian Prime Minister Dmitry Medvedev, who grinned broadly and opened his arms wide while everyone else crossed theirs.

Scroll down for video

HOW DOES THIS WORK? U.S. President Donald Trump quizzically looked at his peers from Asian nations on Monday in the Philippines as they tried to execute the Association of South East Asian Nations traditional cross-armed handshake

I GOT IT! Trump grimaced as he swapped hands with Vietnam's Prime Minister Nguyen Xuan Phuc (left) while Philippine President Rodrigo Duterte (right) waited for his other arm to connect

AMERICA! NUMBER ONE! Ultimately Trump figured out that he had to cross his arms and connect with the group – but Russian Prime Minister Dmitry Medvedev (2nd left) decided not to participate and kept his arms wide open

UNCOMFORTABLE: The president did his best to play along but it was clearly something his staff hadn't prepared him for

THAT'S THE TICKET: Trump broke into an uneasy smile after mastering the confusing cross-ways handshake

THE FINAL PICTURE (left to right): South Korea's President Moon Jae-In, Malaysia's Prime Minister Najib Razak, New Zealand's Prime Minister Jacinda Ardern, Myanmar's State Councellor and Foreign Minister Aung San Suu Kyi, Japan's Prime Minister Shinzo Abe, Thailand's Prime Minister Prayut Chan-O-Cha, Russian Prime Minister Dmitry Medvedev, Vietnam's Prime Minister Nguyen Xuan Phuc, U.S. President Donald Trump, Philippine President Rodrigo Duterte, Australia Prime Minister Malcolm Turnbull, Singapore's Prime Minister Lee Hsien Loong, Canada's Prime Minister Justin Trudeau, Brunei's Sultan Hassanal Bolkiah, Chinese Premier Li Keqiang, Laos Prime Minister Thongloun Sisoulith, Indonesia's President Joko Widodo, India's Prime Minister Narendra Modi, Cambodia's Prime Minister Hun Sen and United Nations Secretary General Antonio Guterres

Photos showed Trump alternatively grimacing and chuckling as he jockeyed for position with Filipino president Rodrigo Duterte, the event's host.

Trump is winding down his lengthy Asia trip by meeting with Pacific Rim allies, including Duterte who is overseeing a bloody drug war.

Trump's attendance at the ASEAN event will include bilateral sit-downs with Duterte, Australian Prime Minister Malcolm Turnbull and Indian Prime Minister Narendra Modi.

Asked Sunday if he believed reports that Duterte's government is conducting extrajudicial narcotics squad executions, White House Chief of Staff John Kelly would only say: 'We'll check it out.'

The ASEAN opening ceremonies included cultural dance performances and a pop ballet

Trump shook hands with President of the Philippines Rodrigo Duterte after he delivered opening remarks in Manila

On Monday Duterte told the ASEAN opening event's audience that 'the menace of the illegal drug trade continues to threaten the fabric of our societies.'

He also thanked the other nations' leaders for helping with a protracted war against the ISIS terror army.

'I apologize for setting the tone of [my] statement in such a manner,' he said, but 'these threats know no boundaries.'

TRADITION: President Barack Obama participated in the cross-armed handshake during the ASEAN meeting in Kuala Lumpur, Malaysia in 2015

STILL NOT SURE: A year later in Ventiane, Laos, Obama was still not quite sure how it worked

NOT JUST FOR PRESIDENTS: Then-Secretary of State Hillary Clinton represented the U.S. at the East Asia Summit meetings in Cambodia in 2012, the last year she served in the Obama cabinet, and the leaders did the same handshake photo-op

The rest of the ceremony was a musical pageant, including Moana-like Pacific Island dances with loud percussion and shouting, a children's choir and orchestra, and a pop ballet based on a traditional Indian epic about a prince who rescues his wife from a demon king.

Afterward, a hip-hop dance troupe paid tribute one by one to the urban cultures of nearly all the nations represented at the summit – all but the United States.

ASEAN organizers did not respond to a request for information about why the U.S. was left out.

Outside of the summit, protesters burned an effigy of Trump with arms fashioned into the shape of a swastika