British intelligence officials have denied an allegation that the UK helped former president Barack Obama “wiretap” Donald Trump during the 2016 election.

The claim was repeated by the White House press secretary, Sean Spicer, on Thursday and dismissed as “utterly ridiculous” by a GCHQ spokesperson.

The spokesperson added in a statement: “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.”

This week, Napolitano, Fox News judicial analyst, claimed during an interview on the network that three intelligence sources confirmed to him that the Obama administration used GCHQ to spy on Trump so that there would be “no American fingerprints on this”.

Sean Spicer, the White House press secretary, quoted Napolitano’s allegation in an effort to validate Trump’s unfounded claim that Obama tapped his phones last year.

British and American intelligence agencies cooperate closely. Along with their counterparts from Australia, New Zealand and Canada, they are members of the Five Eyes, which all work together on intelligence. According to documents released by the whistleblower Edward Snowden, British officials allowed their US counterparts to store and analyse British citizens’ internet and email records. And Snowden also revealed that America’s National Security Agency paid £100m to GCHQ in secret.

Tim Farron, leader of the Liberal Democrats – the junior partner in the last British coalition government – said Trump was “compromising the vital UK-US security relationship to try to cover his own embarrassment”.

Trump started the political firestorm in a series of tweets in early March, when he accused Obama of tapping his phones and called his predecessor a “bad (or sick) guy”. US officials called the allegation groundless.

“Terrible! Just found out that Obama had my ‘wires tapped’ in Trump Tower just before the victory. Nothing found. This is McCarthyism!” Trump tweeted on 4 March.

The president finds himself increasingly alone in his defence of his wiretapping claims. On Thursday, the Republican and Democratic leaders of the Senate intelligence committee joined their counterparts on the House intelligence committee in the conclusion that they had seen no evidence to support the president’s accusation.

During the briefing, Spicer said Trump “stands by it” and emphasised, as he has attempted to do in recent days, that the president was referring broadly to wiretapping as a range of surveillance-related activities. Trump made a similar argument in a Wednesday night interview on Fox News, telling the interview host, Tucker Carlson, that the word wiretap “covers surveillance and many other things”.

He also told Carlson that the administration would submit evidence of his claim to the House intelligence panel “very soon”, adding: “You’re going to find some very interesting items coming to the forefront over the next two weeks.”

In the same interview, he wrongly cited a New York Times report in January about intercepted communications and financial records concerning Trump associates and Russian officials as supporting his claim. Asked why he had not relied on US intelligence for a claim with extraordinary legal implications, Trump offered a quixotic reply: “Because I don’t want to do anything that’s going to violate any strength of an agency.”