The US and Japan said they have agreed to start talks to develop what US president Donald Trump and Japanese prime minster Shinzo Abe described as a new “free, fair and reciprocal” trade deal between the two countries following two days of talks.

But the leaders said they had failed to reach a deal that would exempt Japan from new US steel and aluminium tariffs, as Mr Abe had wanted.

“If we can come to an arrangement on a new deal, that would certainly be something we would discuss,” Mr Trump said during a joint press conference at his private Mar-a-Lago club. But he said the current trade deficit between the two countries is too high for him to offer an exemption now.

Most other key US allies – among them Australia, Canada, the European Union and Mexico – have already been granted exemptions to Mr Trump’s protectionist measures on steel and aluminium.

The US trade deficit with Japan last year was 56.1 billion dollars (£39.4 billion), according to the US Department of Commerce.

Mr Trump said he was working to reduce that imbalance and pushing to remove barriers to US exports.

“We’re committed to pursuing a bilateral trading relationship that benefits both of our great countries,” he said.

Japan has previously voiced reluctance to a bilateral trade deal with the US.

Mr Trump also made clear that he has little interest in rejoining negotiations over the Trans-Pacific Partnership (TPP) trade deal unless the terms are dramatically altered.

“While Japan and South Korea would like us to go back into TPP, I don’t like the deal for the United States,” Mr Trump tweeted on Tuesday, following a dinner with Mr Abe and their respective wives at Mr Trump’s Mar-a-Lago resort. “Too many contingencies and no way to get out if it doesn’t work. Bilateral deals are far more efficient, profitable and better for OUR workers.”

Mr Trump pulled the US out of TPP days after his inauguration but recently said he might be open to rejoining.

During Mr Abe’s two-day visit, Mr Trump appeared to be seeking to reassure him of the pair’s close alliance as the president prepares for a historic summit with North Korean leader Kim Jong Un.

Mr Trump and Mr Abe spent Wednesday morning golfing at one of Mr Trump’s nearby courses in their latest show of “golf diplomacy”, and had an intimate dinner on Tuesday evening with their wives.

The Trump-Abe summit has played out amid growing tensions between the two countries over North Korea and trade.

Japan has raised concerns that the US might press Mr Kim only on long-range missiles that could hit the mainland United States — and not on the short- and medium-range missiles that pose an immediate threat to Japan — as they discuss North Korea’s nuclear weapons programme.

Mr Abe on Tuesday praised Mr Trump for his courage in agreeing to meet with Mr Kim and suggested he and Mr Trump had already come to terms on several issues.

Speaking through a translator during one of their meetings, Mr Abe said that he and Mr Trump had had “very in-depth discussions” on both North Korea and economic issues and that “on those two points” they had “successfully forged a mutual understanding”.

The two did not reveal what those agreements were, but Mr Abe had been expected to urge Mr Trump to exempt Japan from the tariffs and press him on the missile issue.

Larry Kudlow, the director of the National Economic Council, had said earlier Tuesday that issuing Japan the waiver was “on the table”, but he declined to say what Mr Trump would ask for in return.

The talks came amid news that CIA director Mike Pompeo had recently travelled in secret to North Korea to meet with Mr Kim ahead of a US-North Korea summit planned in the next two months.

Mr Trump on Wednesday confirmed the visit in a tweet, saying “a good relationship was formed” heading into their anticipated summit.

“Denuclearization will be a great thing for World, but also for North Korea!” Mr Trump wrote.

On Tuesday, Mr Trump said North and South Korea are negotiating an end to hostilities before next week’s meeting between Mr Kim and South Korean president Moon Jae-in. The meeting will be the third inter-Korean summit since the Koreas’ 1945 division.

“They do have my blessing to discuss the end of the war,” Mr Trump said.

Trump said five locations for the summit are under consideration, but he would not list them.