Britain scrambled on Monday to stem damage to its relations with Washington by finding the leaker of diplomatic cables in which the United Kingdom (UK) ambassador called United States (US) President Donald Trump “inept”.

The confidential telegrams from ambassador Kim Darroch created a political firestorm in London after their publication in the Mail on Sunday newspaper.

One of them called the Trump administration “uniquely dysfunctional” while another characterised the US leader as “incompetent” and “insecure”.

Their release came just a month after Trump visibly enjoyed himself during a state visit that included a 41-gun salute welcome at Buckingham Palace and dinner with the queen.

They also threatened to complicate London’s efforts to strike a new US trade agreement that could help mitigate potential damage from Britain’s withdrawal from the European Union (EU).

Trump fired back by saying that people in his administration were “not big fans” of London’s man in Washington.

“We are not big fans of that man and he has not served the UK well. So I can understand it, and I can say things about him but I won’t bother,” Trump told reporters.

UK officials defended Darroch as a professional who was carrying out his duties by providing “frank” assessments of the latest developments in the White House.

“Our ambassadors provide honest, unvarnished assessments of politics in their country,” a Downing Street spokesman said.

“As you’d expect, contact has been made with the Trump administration setting out our view that we believe the leak is unacceptable.”

Foreign Secretary Jeremy Hunt said the culprit would face “very serious consequences if and when we find out who was responsible.”

The British parliament’s foreign affairs committee chairman Tom Tugendhat called the leak a “betrayal” that was “deeply damaging to the integrity of the UK”. The Daily Telegraph newspaper said such memos are seen by up to 100 people working in the Foreign Office and other government departments.

“But it would require a single official or minister to have access to the whole cache, inevitably casting the spotlight on senior ministers,” it wrote.

The immediate suspicion of the London papers fell on Brexit-backing players in a power struggle within the governing Conservative Party. British politics are in for a major revamp once Prime Minister Theresa May ends her three-year spell in power later this month.

Brexiteer former foreign minister Boris Johnson is the favourite to replace her in a leadership contest against Hunt. The winner will get to appoint his own US envoy by the time Darroch’s term expires at the end of the year.

Commentators note that the official widely tipped for the Washington job was less enthusiastic about Brexit than Johnson or some members of his team.

“There have been reports that Mark Sedwill, the current cabinet secretary, is being lined up for the position,” The Guardian’s diplomatic editor Patrick Wintour wrote. However, Trump “may be suspicious of Sedwill, and would prefer a true Brexiter”.

Wintour wrote that Sedwill “may not fill that bill, but Nigel Farage, who pretty openly campaigned for the job before Darroch’s appointment in 2016, does”.

Farage has met Trump on several occasions and has brandished his anti-European credentials by leading his brand new Brexit Party to victory in European election in May.

Farage on Monday called Darroch’s memos “pretty irresponsible” but played down interest in taking the ambassadorial job in Washington.

“I’m not a diplomat, and I think that’s quite an understatement,” he told BBC radio.

However, Farage added that he “could be very useful” in forging a better relationship “with an administration that contains friends of mine”.