Within minutes, social media exploded with video and photos of the pilot, who identified himself as Oscar Perez, a special operations officer with the national police. In one clip, Perez held a flag that read “Freedom. Article 350” – a reference to the section of Venezuela’s constitution that allows for civil disobedience against an illegitimate regime.

“We have two choices: be judged tomorrow by our conscience and the people or begin today to free ourselves from this corrupt government,” said Perez, standing before four figures dressed in fatigues, wearing ski masks and carrying assault rifles.

President Nicolás Maduro was quick to describe the episode as a terrorist attack aimed at forcing him from power. “It could’ve caused a tragedy with several dozen dead and injured,” he said.

But on Wednesday, speculation was growing that the incident may have been staged by a government eager to divert attention from three months of protests, fueled by mounting anger at the country’s chronic lack of basic foods and medicines.

Why is there unrest in Venezuela?

• The president, Nicolás Maduro, won a general election in 2013 on a platform of continuing his predecessor Hugo Chávez's socialist policies of using the country's oil riches to reduce inequality and lift people out of poverty, but falling oil prices have forced the government to curtail social programmes

• Opposition activists have been staging unrelenting protests against the government. On 26 June a wave of lawlessness that began in the city of Maracay marked the first time that street clashes have spread into more generalised anarchy

Julio Borges, president of the opposition-led assembly, said that he and other opponents of Maduro were still analysing the events.

“It seems like a movie,” he said. “Some people say it is a set-up, some that it is real … but I summarize it like this: a government is decaying and rotting, while a nation is fighting for dignity,” he added.

It soon emerged that Perez had an active Instagram account with images of him posing in fatigues with a German shepherd dog, horse riding, and scuba diving while clutching a rifle. The account has since been deleted.

He also has an eclectic CV which included a starring role in a 2015 action movie called Suspended Death in which he played an investigator rescuing a kidnap victim.

In an interview with a local TV station to promote the movie, Perez said: “I am a helicopter pilot, a combat diver and a free parachutist. I am also a father, a companion and an actor ... I am a man who goes out without knowing if he will return home because death is part of evolution.”

According to the minister of information, Ernesto Villegas, who spoke a couple hours after the attack, Perez launched four Israeli-made grenades of “Colombian origin”, one of which did not explode. No one was hurt in the incident and on Wednesday morning there were no visible signs of damage outside either building.

Villegas also said security forces had been deployed to arrest Perez, whose helicopter was found abandoned in a remote region on the Caribbean coast on Wednesday.

“We ask for maximum support to find this fanatic, extremist terrorist,” said vice president Tareck El Aissami.

Meanwhile a group of opposition legislators said that they were being held against their will inside the National Assembly by armed militiamen loyal to Maduro.

Venezuela president says supporters will take up arms if government falls

Read more

And the attack came hours after one of the worst outbreaks of looting since protests erupted in April. For most of Monday night and Tuesday the city of Maracay – which is home to one of the country’s most important military bases – was wracked by a wave of unrest in which at least 64 shops were sacked. It is unclear why the National Guard was unable to contain the rioting.

More than 70 people have been killed, and thousands injured in the latest wave of unrest.

Earlier on Tuesday, Maduro had warned that he and his supporters would take up arms “where ballots failed”, to defend the “Bolivarian revolution” of his predecessor Hugo Chávez.

Analysts warned that the threat of violence was not empty.

“Regardless of whether this was a hoax or an act by a lunatic, the impact is the same: it suggests that the government is entering a new stage and willing to escalate violence,” said Phil Gunson, a senior analyst at the International Crisis Group.

“It seems the government is trying to find the right level of repression that can put the ‘genie back in the bottle’.”