Media playback is unsupported on your device Media caption The White House press secretary pointed to Fox News sources

The US has agreed not to repeat claims the UK's communications intelligence agency wiretapped Donald Trump during the presidential election campaign.

GCHQ rejected allegations made by White House press secretary Sean Spicer, that it spied on Mr Trump, as "nonsense".

No. 10 has been assured by Mr Spicer he would not repeat the claims, which he cited from US TV channel Fox News.

The White House has said that Mr Spicer was "simply pointing to public reports, not endorsing any specific story".

A spokesman for Prime Minister Theresa May said it had been made clear to US authorities the claims were "ridiculous and should have been ignored".

Former foreign secretary Sir Malcolm Rifkind said it was not enough to promise not to repeat the allegation.

"That's not the same as saying it was rubbish in the first place," he told the BBC.

GCHQ rejected the allegations as "utterly ridiculous". The unusual move by the agency to comment on the news came after Mr Spicer cited claims first made on Fox News earlier this week.

Mr Trump said Trump Tower in New York was under surveillance, but has provided no evidence for the claim.

The allegations of GCHQ involvement were initially made by former judge Andrew Napolitano.

Mr Spicer quoted Mr Napolitano as saying: "Three intelligence sources have informed Fox News that President Obama went outside the chain of command."

He said Mr Obama "didn't use the NSA, he didn't use the CIA, he didn't use the FBI and he didn't use the Department of Justice, he used GCHQ.

"What the heck is GCHQ? That's the initials for the British spying agency. They have 24/7 access to the NSA database."

A GCHQ spokesman said: "Recent allegations made by media commentator Judge Andrew Napolitano about GCHQ being asked to conduct 'wiretapping' against the then president-elect are nonsense.

"They are utterly ridiculous and should be ignored."

Analysis: A rare response from GCHQ

By Frank Gardner, BBC security correspondent:

Image copyright PA Image caption British intelligence relocated GCHQ from Bletchley Park to a new site in Cheltenham

It's a bad day for the transatlantic intelligence community when Britain's largest and best funded spy agency - GCHQ - has to come out and publicly contradict a claim made by its closest ally.

GCHQ, MI6 and MI5 rarely, if ever, comment on ongoing intelligence stories in the news.

But the allegation made by Mr Spicer was seen as so potentially damaging - as well as being untrue - that it was decided to make an exception.

The BBC understands that a discussion was held earlier this week in No 10 on whether and how to respond.

When Mr Spicer repeated his claim of GCHQ collusion on Thursday the strongly-worded denial was written and published.

Career intelligence officers on both sides of the Atlantic will now be at pains to protect their historically-close relationship from any further perceived gaffes coming out of the White House.

Sir Malcolm, speaking on BBC Radio 4's World at One, said the allegations were "foolish and very dangerous" as they implied UK government involvement.

"It's not just about GCHQ", he said. "The inference is that the British government - either directly or indirectly - were involved."

Media playback is unsupported on your device Media caption "What is needed is a clear unambiguous statement from the White House" Sir Malcom Rifkind tells The World at One

Former MI5 intelligence officer Ben Owen said he would be "shocked" if the claims turned out to be true.

"It's not something GCHQ would do", he told the BBC's Victoria Derbyshire programme. "They have to stick to the letter of the law."

He said leaks by Edward Snowden, a former contractor for the CIA, had eroded public trust in intelligence agencies.

"These stories have more credence with the public," he said.

Media playback is unsupported on your device Media caption President Trump's wiretap saga explained in two minutes

The allegations relate to Mr Trump's earlier claim that his phones were tapped by predecessor Barack Obama during the presidential race.

He tweeted on March 4: "Just found out that Obama had my 'wires tapped' in Trump Tower just before the victory. Nothing found."

A Senate committee on Thursday concluded that there were "no indications" Trump Tower was under surveillance by the US government before or after the election.

Image copyright Twitter

Michael Clarke, the former director of the defence think tank Rusi, said that relations between President Trump and US agencies had "got worse".

He told BBC Radio 4: "After the election, it was hoped that the relationship between President Trump and the American agencies would settle down and it hasn't."

Mr Spicer said Mr Trump stood by his allegations.

GCHQ is one of three UK intelligence and security agencies, along with MI5 and MI6. It delivers signals intelligence - the intercepting of communication between people or electronic devices - to the prime minister and foreign secretary.

The agency credits its "particularly strong" relationship with its US equivalent, the National Security Agency, to the collaboration it began at Bletchley Park during World War Two.