US President Barack Obama said Sunday that leaders from across the Asia-Pacific have decided to move ahead with a trade deal opposed by his successor Donald Trump.

"Our partners made clear they want to move forward with TPP," Obama said at a press conference after meeting leaders in Peru.

"They would like to move forward with the United States."

It is unclear whether there is any future for the Trans-Pacific Partnership, or TPP, a vast, arduously negotiated agreement between 12 countries that are currently at different stages of ratifying it. It does not include China.

Trump campaigned against the proposal as a "terrible deal" that would "rape" the United States by sending American jobs to countries with cheaper labor.

The agreement must by ratified in the US Congress -- which will remain in the hands of Trump's Republican allies when the billionaire mogul takes office on January 20.

Without the United States, it cannot be implemented in its current form.

However, some have suggested Trump could negotiate a number of changes and then claim credit for turning the deal around.

Obama defended the increasing integration of the global economy at the close of his final foreign visit as president -- a trade summit held against the backdrop of rising protectionist sentiment in the United States and Europe, seen in both Trump's win and Britain's "Brexit" vote.

He said that "historic gains in prosperity" thanks to globalization had been muddied by a growing gap "between the rich and everyone else."

"That can reverberate through our politics," he said.

"That's why I firmly believe one of our greatest challenges in the years ahead across our nations and within them will be to make sure that the benefits of the global economy are shared by more people."

And he sent a message to a world that is growingly wary of globalization.

"The answer is to do trade right," he said.