Image copyright AP Image caption Canadian Prime Minister Stephen Harper (left) Mexican President Enrique Pena Nieto (centre), and US President Barack Obama met in Toluca, Mexico

US President Barack Obama has vowed to expand trade agreements between North America and Asia, despite concerns within his own political party.

Ending a day of talks with the leaders of Mexico and Canada, Mr Obama said they must keep up their "competitive advantage".

The three countries are negotiating a major Pacific trade deal.

But Mr Obama's Democratic allies oppose the agreement amid concerns that American jobs could be lost.

The US president was in Toluca, Mexico, on Wednesday to discuss trade, immigration and energy issues with the Canadian and Mexican leaders.

Jobs at risk?

Specifically, they addressed the Trans-Pacific Partnership (TPP), a regional pact among 12 nations that would be one of the world's biggest trade deals.

"We'll get this passed if it's a good agreement," Mr Obama said during an end-of-summit news conference with Mexican President Enrique Pena Nieto and Canadian Prime Minister Stephen Harper.

The talks between the three nations, sometimes known as the Three Amigos, highlighted the changes to their economies in the two decades since another major trade agreement among them, Nafta, took effect.

Mr Pena Nieto said new trade deals were "bound to go beyond and enhance all together the progress that each one of our countries has made" since Nafta.

Mr Harper echoed their words of support for the TPP, saying he was "focused on bringing those negotiations to a successful conclusion".

But back in the US, the president's own Democratic congressional allies - with an eye on November's midterm elections - are blocking his attempts to expedite the trade agreement.

Union leaders warn such a trade deal could harm American jobs, while environmental groups say it would increase pollution.

Sources of frustration

At the news conference, Mr Obama also said immigration remained one of his "highest priorities".

Mexican officials would like to see America's immigration laws overhauled, but US Republican leaders have said little progress is likely before November's elections.

The only other source of frustration to emerge between the three allies on Wednesday was Canada's call for approval of the long-stalled Keystone XL oil pipeline.

Mr Obama said he would continue to examine the project's potential environmental effect.

"I said previously that how Keystone impacted greenhouse gas emissions would affect our decision, but frankly it has to affect all of our decisions at this stage," he said.

There was a fresh setback for the project on Wednesday as a judge in Nebraska struck down a law allowing a route for the pipeline through that US state.