Boris Johnson has sided with Donald Trump in calling the 2015 nuclear agreement with Iran a “bad deal”, while praising the US president as a “very brilliant negotiator” capable of achieving a better one.

The prime minister’s remarks, made in a NBC interview, marked a sharp change in UK rhetoric. British leaders, including Johnson, had until now upheld the 2015 accord between six major powers and Iran as a major diplomatic achievement.

British officials insisted that the prime minister continued to support full compliance with that deal, known as the Joint Comprehensive Programme of Action (JCPOA).

However, Johnson had clearly come to the UN determined to emphasise his personal relationship with Trump, who reneged on the JCPOA last year, praising him highly in the interview, comments that may prompt an interesting discussion when Johnson meets with Iranian president Hassan Rouhani for a bilateral meeting today.

Asked about the JCPOA, Johnson said: “The reality is, as President Trump rightly said, it was a bad deal. It had many defects. Iran was and is behaving disruptively in the region.”

“If it was a bad deal – and I’m willing to accept that, it had many, many defects – then let’s do a better deal.

“And I think there’s one guy who can do a better deal and one guy who understands how to get a difficult partner like Iran over the line and that is the president of the United States.”

Johnson described Trump as a “very, very brilliant negotiator” who could produce a “Trump deal”.

On the prospect of a US military response to airstrikes against Saudi oil installations on 14 September, Johnson replied: “It’s not something that I think will necessarily help the situation.”

Johnson’s remarks came as the UK, France and Germany declared they were convinced that Iran was responsible for the attacks and called on Tehran to negotiate over its role in the Middle East and its development of missiles as well as its nuclear programme.

In a joint statement at the UN general assembly on Monday, the three European governments supported the US and Saudi claim that Iran had carried out the missile and drone attack, but added they maintained support for the JCPOA.

“It is clear to us that Iran bears responsibility for this attack. There is no other plausible explanation. We support ongoing investigations to establish further details,” the statement said following a meeting between Johnson, the German chancellor, Angela Merkel, and the French president, Emmanuel Macron.

The statement said that the attack raised the risk of a major new conflict, which was of concern to the whole world. It underlined the importance of collective security and multilateral action.

The statement also restated the European nations’ commitment to the 2015 nuclear deal.

Asked whether Johnson’s undertaking in the European statement clashed with his remarks on the US evening news, a UK official insisted there was a coherent message.

“What this is about is achieving compliance, and we’re open to various ways of achieving that,” he said.

“Our commitment is to working with all of our partners to find solutions to bring Iran into compliance. In his interview I think he was clear he wants to work with all our partners.”

The European agreement called for Iran to return to the limits on its nuclear programme imposed by that agreement, which Tehran has begun to ignore more than a year after the US withdrew from the deal.

But the statement said Iran would now have to go further, arguing “the time has come for Iran to accept a long-term negotiation framework for its nuclear program, as well as regional security issues, which include its missile programs,” the statement said.

Iran has denied responsibility, insisting the strikes were launched from Yemen by their Houthi allies.

On Monday night Iran ruled out the possibility of negotiating a new deal with major powers. Iranian foreign minister Mohammad Javad Zarif said in a tweet that European partners have failed to fulfil their commitments under a 2015 nuclear pact.

France has sent investigators to examine the weapons fragments collected at the site of the attacks. The UN has also sent an investigative team, which has yet to deliver a report. Iran has said it will not necessarily accept the results of that report, calling into question the impartiality of the UN team.

The European statement comes as the US and Iran are poised to clash at the UN general assembly. Donald Trump is due to address the assembly on Tuesday, and the Iranian president, Hassan Rouhani, who has already arrived in New York, will speak the next day. Both are expected to blame the other for the worsening instability in the Gulf.