Prime Minister Justin Trudeau just completed his first official meeting with U.S. President Barack Obama on Thursday at the Asia Pacific Economic Co-operation leaders' summit in Manila.

The prime minister and his wife Sophie Grégoire-Trudeau have been invited to Washington and are expected to go early in the new year, it was revealed.

It was their first formal meeting since Trudeau took office, although the leaders have spoken by telephone and have been seen chatting informally at the G20 gathering earlier this week in Turkey.

The two leaders talked about topics including security, including the fight against the Islamic State in Iraq and Syria (ISIS), the economy, trade and reducing greenhouse gas emissions.

"It's going to be a wonderful time of strengthening ties between our two countries – both on the economic, on the security, on the engagement with the world and on a personal level," Trudeau said.

Trudeau said Obama had been very "vocal and helpful" since he was elected.

There were moments of warmth in the conversation, with Obama joking about what the role of leader might do to Trudeau's appearance.

"I just want to point out that I had no grey hair when I was in your shoes seven years ago and so, if you don't want to go grey like me, you need to start dyeing it soon before it's too late," Obama said.

"So young and yet so cynical," an amused Trudeau responded.

Obama offers advice to Justin Trudeau0:49

Obama said the prime minister is a "great boost of energy" for Canada's political landscape. 

Common ground on refugee policy

Trudeau again said Canada will do "more than its part" and remain a strong member of the campaign against ISIS, which has claimed responsibility for the deadly Paris attacks of Nov. 13, and the downing of a Russian plane over Egypt.

Trudeau and Obama talk security during APEC meeting3:39

He has promised to withdraw Canada's CF-18 fighter jets from the U.S.-led coalition bombing militants in Syria and Iraq but two days ago said he wants to increase the number of Canadian special forces on the ground to train local fighters.

"Canada will continue to work with our coalition partners to ensure that we are doing what we can, including militarily to degrade and defeat ISIL over the long haul," Trudeau said, using another commonly used acronym for the militant group.

Trudeau and Obama are on the same page on bringing Syrian refugees to North America and working together to push reluctant countries to adopt a binding climate change agreement at the upcoming international summit in Paris.

In his introductory remarks, Obama said both countries would soon be signatories to the Trans Pacific Partnership trade deal, despite the fact Canada's new government has not yet committed to the deal.

Trudeau and Trade Minister Chrystia Freeland have said the Liberals will have an open dialogue on the merits of the pact before signing off.

"I know Justin has to agree with what's happened but we think that after that process has taken place Canada, the United States and the other countries that are here can establish the high standards agreement that protects labour, protects the environment, protects the kind of high value-added goods and services that we both excel in," Obama said.

With respect to the environment, Obama rejected the Keystone XL pipeline project earlier this month, saying he had environmental concerns about approving the transport of dirty oil from Alberta across the United States. Trudeau said at the time he was disappointed with the decision, but that economic relationship between the two countries was "much bigger than any one project."

Obama on Alberta Oil3:13

A copy of a declaration that the leaders will issue following their talks in Manila, seen by The Associated Press, said they "strongly condemn all acts, methods, and practices of terrorism."

The leaders said they are stressing the "urgent need for increased international co-operation and solidarity in the fight against terrorism" and would not allow terrorism to "threaten the fundamental values that underpin our free and open economies."

With files from Catherine Cullen, The Canadian Press & Associated Press