Vladimir Padrino, the defence minister, Maikel Moreno, the head of the Supreme Court, and Ivan Rafael Hernandez Dala the head of the presidential guard, were all named as being prepared to turn on the Venezuelan president.

Mr Bolton said that the plan involved the Supreme Court saying that Mr Guaido, who has cited the constitution in declaring himself interim president, was the rightful leader, with that in turn giving “cover” for the military to defect.

Elliott Abrams, the US envoy for Venezuela, went a step further, saying that a 15-point document had been discussed between Mr Guaido’s allies and members of Mr Maduro’s inner circle.

However on Thursday it appeared that the plot had fallen short, with Mr Padrino appearing alongside Mr Maduro in a high profile show of support and criticising those behind the attempted military uprising.

Mr Padrino spoke out against “anti-democratic, fascist, extremist and far-right” figures in the country, saying they had nothing to offer Venezuela and shouting: “Always loyal, never traitors!”

A Venezuelan court also issued an arrest warrant for Leopoldo Lopez, the well known opposition politician who had escaped from house arrest to take to the streets in protest.

Mr Lopez had appeared by Mr Guaido’s side on Tuesday in a video which called for a military uprising to topple Mr Maduro but has since sought refuge in the Spanish embassy.

There were signs that some top figures have abandoned Mr Maduro, the embattled socialist president who remains clinging to power despite a slumping economy and nationwide blackouts.

Manuel Ricardo Cristopher Figuera, the head of Venezuela’s secret police, was sacked earlier this week, a move that senior US officials see as significant.

Fresh details of the plot – which Mr Maduro and his allies call a “coup” – have emerged in recent days as Trump administration figures have gone public with their support for Mr Guaido.

The US is among more than 50 countries backing his claim to power. Mr Bolton gave a detailed account of the plot to Hugh Hewitt, a radio talkshow host, while insisting that the US was not involved the plans.

Mr Bolton said: “Senior officials of the Maduro regime were flatly agreeing that Maduro had to go.

“They had documents they were prepared to sign with opposition leader Juan Guaido that would embody their agreement and the steps that would be taken.

“The Supreme Court would declare Maduro’s constituent assembly illegitimate. That would clarify for everybody, if anybody needed clarification, the legitimacy of the national assembly led by Juan Guaido.

“And then that would have allowed the military to cover themselves in a way, Defense Minister Padrino and others, to take action. Now for reasons that are still not clear, that didn’t go forward [on Tuesday].”

Elliott Abrams, the US envoy for Venezuela, gave more details to the Venezuelan channel, VPITV.

He said: “There is a document. The US was not involved in the negotiations, but they tell me it is a long document – there are 15 points I think – it mentions guarantees for the military, a dignified exit for Maduro, Guaido as interim president, the Supreme Court and the high command stay in position, free elections within 12 months.”

Donald Trump, the US president, said on Thursday: “I’d like to begin by sending our prayers to the people of Venezuela in their righteous struggle for freedom. The brutal repression of the Venezuelan people must end, and it must end soon.”