Drones armed with explosives detonated near Venezuelan President Nicolas Maduro in an apparent assassination attempt that took place while he was delivering a speech to hundreds of soldiers being broadcast live on television, government officials said.

Caught by surprise mid-speech, Maduro and his wife, Cilia Flores, looked up at the sky and winced after hearing the sound of an explosion pierce the air.

"This was an attempt to kill me," he said later in an impassioned retelling of the events. "Today they attempted to assassinate me."

Information Minister Jorge Rodriguez said the incident took place shortly after 5:30 p.m. local time as Maduro was celebrating the National Guard's 81st anniversary. The visibly shaken head of state said he saw a "flying device" that exploded before his eyes. He thought it might be a pyrotechnics display in honour of the event.

Within seconds, Maduro said he heard a second explosion and pandemonium ensued. Bodyguards escorted Maduro out of the event and television footage showed uniformed soldiers standing in formation quickly scattering from the scene.

<a href="https://twitter.com/hashtag/HaceMinutos?src=hash&ref_src=twsrc%5Etfw">#HaceMinutos</a> Aparente explosión en acto de Maduro genera confusión <a href="https://t.co/U4bhFpk988">https://t.co/U4bhFpk988</a> <a href="https://t.co/hUcg19roXg">pic.twitter.com/hUcg19roXg</a> —@NTN24ve

He said the "far right" working in co-ordination with detractors in Bogota and Miami, including Colombian President Juan Manuel Santos, were responsible. Some of the "material authors" of the apparent attack have been detained.

"The investigation will get to the bottom of this," he said. "No matter who falls."

Venezuela's government routinely accuses opposition activists of plotting to attack and overthrow Maduro, a deeply unpopular leader who was recently elected to a new term in office in a vote decried by dozens of nations. Maduro has steadily moved to concentrate power as the nation reels from a crippling economic crisis.

In the midst of near-daily protests last year, a rogue police officer flew a stolen helicopter over the capital and launched grenades at several government buildings. Oscar Perez was later killed in a deadly gun battle after over six months on the lam.

'We are in the midst of a wave of civil war'

Attorney General Tarek William Saab said the attempted assassination targeted not only Maduro, but rather the military's entire high command on stage with the president.

Prosecutors have already launched their investigation and obtained critical details from the suspects in custody, said Saab, adding that he would give more details Monday.

"We are in the midst of a wave of civil war in Venezuela," Saab said.

Firefighters at the scene of the blast disputed the government's version of events. Three local authorities said there had been a gas tank explosion inside an apartment near Maduro's speech where smoke could be seen streaming out of a window. They provided no further details on how they had reached that conclusion.

Security forces check a building after an explosion was heard near where Maduro was making a speech. (Juan Barreto/AFP/Getty Images)

A Colombian official with the president's office described Maduro's claims that Santos was involved in the attack as baseless.

Adding to the confusion, a little known group calling itself "Soldiers in T-shirts" claimed responsibility, saying it planned to fly two drones loaded with explosives at the president, but government soldiers shot them down before reaching its target. The Associated Press could not independently verify the authenticity of the message.

"We showed that they are vulnerable," the group said in a tweet. "It was not successful today, but it is just a matter of time."

The organization did not respond to a message from The Associated Press.

'He will use it to concentrate power'

David Smilde, a senior fellow at the Washington Office on Latin America who has spent decades researching Venezuela, said the incident did not appear to be a staged attack by Maduro's government for political gain.

The "amateurish" attack prompted embarrassing images of Maduro cut off mid-sentence with droves of soldiers running away in fear, making the president appear vulnerable, Smilde noted. Despite the optics, Smilde said he suspected that Maduro would nonetheless find a way to take advantage of it.

"He will use it to concentrate power," Smilde said. "Whoever did this, he'll use it to further restrict liberty and purge the government and armed forces."

Security personnel surrounded Maduro with what appeared to be a black bullet-proof barrier as they escorted him from the site. (Xinhua via AP)

The event had been just one more of many Maduro routinely holds with members of the military, a key faction of Venezuelan society whose loyalty he has clung to as the nation struggles with crippling hyperinflation and shortages of food and medicine.

"We are going to bet for the good of our country," Maduro declared triumphantly moments before the explosion. "The hour of the economy recovery has come."

Images being shared on social media showed officers surrounding Maduro with what appeared to be a black bullet-proof barrier as they escorted him from the site. Maduro said at no point did he panic, confident the military would protect him.

"That drone came after me," he said. "But there was a shield of love that always protects us. I'm sure I'll live for many more years."