One of the negotiators on the Venezuelan side was allegedly Defence Minister Vladimir Padrino Lopez, who is thought to have had a last-minute change of heart.

The Trump administration had an agreement in place with Venezuela's military that President Nicolas Maduro would be arrested during this week's attempted coup, the Spanish newspaper ABC reports, citing a source in the US National Security Council.

Washington apparently reached the deal with Venezuelan Defence Minister Vladimir Padrino Lopez via phone talks conducted over the past few months.

READ MORE: ‘A Complete Failure’: Venezuelan Coup Attempts Staged ‘More For The US Audience’

Padrino, alongside other ministers and generals, is said to have accepted the agreements drafted by the self-proclaimed acting president, Juan Guaido. This roadmap would include a call for fresh elections within a month — one of Guaido's main promises — and the recognition of the opposition lawmaker as the "legitimate and interim" head of state.

In turn, president of the Supreme Tribunal of Justice Maikel Moreno, a Maduro ally, had reportedly planned to declare illegitimate the Constituent Assembly, a parallel legislature loyal to Maduro convened by a presidential decree in 2017 in defiance of the opposition-held National Assembly.

This move, as per the report, would legally allow the military to notify Maduro that he was either leaving the country for Cuba or would be detained by court order.

The agreements were supposed be signed at the military base La Carlota in Caracas, from where Guaido, on Tuesday, urged the armed forces and civilians in a video address to join what he called the final push to topple Maduro.

However, his coup attempt did not gain enough traction to oust the president, with the military leadership voicing their support for the government.

According to ABC, White House officials are not aware of what happened on Tuesday, while some sources apparently believe that the coup was derailed by Padrino, who backed out at the last minute.

Incidentally, the US special envoy to the Bolivarian republic, Elliott Abrams, said on Wednesday that the high-ranking Venezuelan officials who had earlier negotiated Maduro's departure had "turned off their cellular".

Maduro on Thursday met with top military officials, calling on them to repel "any coup plotter". "No one can be afraid — it is the hour to defend our right to peace," he said at a ceremony attended by some 4,500 military personnel.

General Padrino, who also attended, said: "We've come to ratify our loyalty… to the supreme commander of the armed forces, who is our only president, President Nicolas Maduro."