Prime Minister John Key has taken a swipe at Republican presidential front runner Donald Trump, saying America cannot build a wall across its borders.

Photo: AFP

Mr Key is in Washington for the nuclear summit, and spoke about trade and the Trans-Pacific Partnership (TPP) at the US Chamber of Commerce.

His speech mostly focused on the growing Asia market and trade, saying countries need to compete in an open playing field.

Mr Key said closing borders would not work, referring to Mr Trump's comments that he wanted to build a wall between the US and Mexico.

"You can't build a wall, with the greatest respect to the United States, around it. There is a plan to do that, but you can't actually do that, and imagine it is going to work. It's not. You have to get out there and compete."

Mr Key warned the Americans they could not afford to not be part of the TPP deal.

"And that is one of the reasons, I think, why the United States needs to continue to show leadership in the region, because if it abdicates leadership in the region, that role will get filled. It has to. In the end, these economies aren't going to stand still."

International trade expert Charles Finney said he agreed with Mr Key.

"If you look at the way in which the rules are written, it's just not going to be the TPP without the United States, but I'm sure the members who have ratified what we are calling the TPP would get together and negotiate something else, and others would be joining that something else, and it would be long-term, to the cost of the United states.

Mr Finney said he believed the TPP would still go ahead in the US, regardless of the upcoming election.