Venezuelan President Nicolas Maduro said a police helicopter fired on the country's Supreme Court on Tuesday in a confusing incident that he called a thwarted "terrorist attack" aimed at ousting him from power.

The exchange took place as Maduro was speaking live on state television to pro-government journalists. More than an hour after the flyover ended, he told the audience that the helicopter had fired on offices of the court as a social event was taking place and launched a grenade that didn't explode. He said the nation's air defence was activated, preventing any loss of life.

Venezuela's President Nicolas Maduro speaks during a gathering in support of him on Tuesday. Maduro said the Supreme Court was attacked from a helicopter. (Miraflores Palace via Reuters)

"It could've caused a tragedy with several dozen dead and injured," said Maduro, who sounded alternately calm and angry as he told the audience about what had happened in the airspace just beyond the presidential palace where they were gathered.

Associated Press reporters heard what sounded like loud gunfire as a blue helicopter buzzed through downtown around sunset but was unable to confirm where the explosions were coming from.

Opponents accuse president of ruse

Meanwhile many of Maduro's opponents on social media accused the president of orchestrating an elaborate ruse to justify a crackdown against Venezuelans seeking to block his plans to rewrite the constitution. Venezuela has been roiled by anti-government protests the past three months that have left at least 75 people dead and hundreds injured.

Adding to the intrigue, pictures of a blue police helicopter carrying an anti-government banner appeared on social media around the same time as a video in which a pilot for the police squad, identified as Oscar Perez, called for a rebellion against the Maduro's "tyranny" as part of a coalition of members of the security forces.

"We have two choices: be judged tomorrow by our conscience and the people or begin today to free ourselves from this corrupt government," the man said while reading from a statement with four people dressed in military fatigues, ski masks and carrying what look like assault rifles standing behind him.

There were no immediate reports of casualties.

Widespread looting

Maduro said one of the pilots involved in the alleged attack used to fly for his former Interior Minister, Miguel Rodriguez Torres, who he accused of working for the CIA. Rodriguez Torres, who has been leading a campaign against by Maduro made up of leftist supporters of the late Hugo Chavez, immediately dismissed the accusation as baseless.

The helicopter incident capped a volatile 24 hours that began with widespread looting in the coastal city of Maracay on Monday night and continued Tuesday when opposition lawmakers got into a heated scuffle with security forces assigned to protect the National Assembly.

At least 68 supermarkets, pharmacies and liquor stores were looted and several government offices burned following anti-government protests in Maracay, which is about a 90-minute drive from Caracas.

On Tuesday, opposition lawmakers got into fisticuffs with national guardsmen as they tried to enter the National Assembly. At nightfall, a few dozen people were still gathered inside the neoclassical building as pro-government supporters stood outside threatening violence.