A Venezuelan police helicopter strafed the Supreme Court and a government ministry on Tuesday, escalating the OPEC nation's political crisis in what President Nicolas Maduro called an attack by “terrorists” seeking a coup.

The aircraft fired 15 shots at the Interior Ministry, where scores of people were at a social event, and dropped four grenades on the court, where judges were meeting, officials said.

However, there were no reports of injuries.

“Sooner rather than later, we are going to capture the helicopter and those behind this armed terrorist attack against the institutions of the country,” Maduro said.

“They could have caused dozens of deaths,” he said.

The 54-year-old socialist leader has faced three months of protests from opposition leaders who decry him as a dictator who has wrecked a once-prosperous economy. There has been growing dissent too from within government and the security forces.

At least 75 people have died, and hundreds more been injured and arrested, in the anti-government unrest since April.

Demonstrators are demanding general elections, measures to alleviate a brutal economic crisis, freedom for hundreds of jailed opposition activists, and independence for the opposition-controlled National Assembly legislature.

Maduro says they are seeking a coup against him with the encouragement of a US government eager to gain control of Venezuela's oil reserves, the largest in the world.

Venezuela's government said in a communique the helicopter was stolen by investigative police pilot Oscar Perez, who declared himself in rebellion against Maduro.

Images shared on social and local media appear to show Perez waving a banner from the helicopter reading “Liberty”, and the number “350” in large letters.

The number refers to the constitutional article allowing people the right to oppose an undemocratic government.

A video posted on Perez' Instagram account around the same time showed him standing in front of several hooded armed men, saying an operation was underway to restore democracy.

Perez said in the video he represented a coalition of military, police and civilian officials opposed to the “criminal” government, urged Maduro's resignation and called for general elections. “This fight is... against the vile government. Against tyranny,” he said.

Local media also linked Perez to a 2015 action film, Suspended Death, which he co-produced and starred in as an intelligence agent rescuing a kidnapped businessman.

On Tuesday, witnesses reported hearing several detonations in downtown Caracas, where the pro-Maduro Supreme Court, the presidential palace and other key government buildings are located.

Opponents to Maduro view the Interior Ministry as a bastion of repression and also hate the Supreme Court for its string of rulings bolstering the president's power and undermining the opposition-controlled legislature.

Opposition leaders have long been calling on Venezuela's security forces to stop obeying Maduro.

However, there was also some speculation among opposition supporters on social media that the attack could have been staged to justify repression or cover up drama at Venezuela's National Assembly, where two dozen lawmakers said they were being besieged by pro-government gangs.

National Assembly President Julio Borges expressed doubts about Maduro's version of events but said that he and the rest of the opposition were still analyzing what happened.

“There are people who say it was a government-staged hoax, others who say it was real.... Whatever it was, it all points in the same direction: that the situation in Venezuela is unsustainable,” he said in a radio interview on Wednesday.

Earlier on Tuesday, Maduro warned that he and supporters would take up arms if his socialist government was violently overthrown by opponents.

“If Venezuela was plunged into chaos and violence and the Bolivarian Revolution destroyed, we would go to combat. We would never give up, and what couldn't be done with votes, we would do with arms, we would liberate the fatherland with arms,” he said.

Maduro, who replaced Hugo Chavez in 2013, is pushing a July 30 vote for a special super-body called a Constituent Assembly, which could rewrite the national charter and supersede other institutions such as the opposition-controlled congress.

He has touted the assembly as the only way to bring peace to Venezuela. But opponents, who want to bring forward the next presidential election scheduled for late 2018, say it is a sham poll designed purely to keep the socialists in power.

They are boycotting the vote, and protesting daily on the streets to try and have it stopped.

Maduro said the “destruction” of Venezuela would lead to a huge refugee wave dwarfing the Mediterranean migrant crisis.

“Listen, President Donald Trump,” he said earlier on Tuesday. “You would have to build 20 walls in the sea, a wall from Mississippi to Florida, from Florida to New York, it would be crazy... You have the responsibility: stop the madness of the violent Venezuelan right wing.”

Opposition to the 30 July vote has come not just from Venezuelan opposition parties but also from the chief state prosecutor Luisa Ortega and one-time government heavyweights such as former intelligence service boss Miguel Rodriguez.

In pictures: The crisis in Venezuela Show all 22 1 /22 In pictures: The crisis in Venezuela In pictures: The crisis in Venezuela A girl scavanges for food in the streets of Caracas Getty Images In pictures: The crisis in Venezuela A man scavenges for food next to girls in the streets of Caracas. Venezuelan President Nicolas Maduro is resisting opposition efforts to hold a vote on removing him from office. The opposition blames him for an economic crisis that has caused food shortages Getty Images In pictures: The crisis in Venezuela Venezuelans line up to get the 'Fatherland's Card' at Bolivar Square in Caracas Getty Images In pictures: The crisis in Venezuela The mother of Venezuelan Rebecca Leon, who scavenges for food in the streets of Caracas, feeds her grandson at their house in Petare shantytown. Getty Images In pictures: The crisis in Venezuela Venezuelan Rebecca Leon, who scavenges for food in the streets of Caracas, with her two-year-old son at her house in Petare shantytown Getty Images In pictures: The crisis in Venezuela Members of a pro-government community organisation work in an expropriated bakery in Caracas. Supported by popular militiamen, Venezuelan government inspectors oversee bakeries as bread comes out of the oven, to undermine an alleged plot to induce scarcity of this staple food Getty Images In pictures: The crisis in Venezuela Forensic police stand next to the body of a man outside a supermarket, where he died of a heart attack after waiting in a long line to buy food, in Caracas Getty Images In pictures: The crisis in Venezuela Venezuelan opposition activists take part in a protest against the government of President Nicolas Maduro at the Francisco Fajardo highway in Caracas Getty Images In pictures: The crisis in Venezuela National guard throws a tear gas canister during a rally against Venezuela's President Nicolas Maduro's government in Caracas, Venezuela Reuters In pictures: The crisis in Venezuela Opposition supporter shouts at a police officer during a rally against Venezuela's President Nicolas Maduro's government in Caracas Reuters In pictures: The crisis in Venezuela Opposition supporters clash with national guards during a rally against Venezuela's President Nicolas Maduro's government in Caracas Reuters In pictures: The crisis in Venezuela A boy wearing a t-shirt with the colours of the Venezuelan national flag, during a demonstration against President Nicolas Maduro's government at Foreign Affairs Ministery, in Buenos Aires, Argentina AP In pictures: The crisis in Venezuela Protesters cover themselves from tear gas fired by the Venezuelan National Guard officers during a protest in Caracas AP In pictures: The crisis in Venezuela Opposition supporters clash with national guards during a rally against Venezuela's President Nicolas Maduro's government in Caracas Reuters In pictures: The crisis in Venezuela Venezuelan opposition activists take part in a protest -blocked by the National Guard- against the government of President Nicolas Maduro at the Francisco Fajardo highway in Caracas Getty Images In pictures: The crisis in Venezuela A Venezuelan national guard reacts to the effect of pepper spray during a protest of opposition supporters against Venezuela's President Nicolas Maduro's government in Caracas Reuters In pictures: The crisis in Venezuela Opposition supporters holding a Venezuelan flag protest against Venezuela's President Nicolas Maduro's government during a rally in Caracas Reuters In pictures: The crisis in Venezuela Opposition supporters clash with riot police during a protest against Venezuela's President Nicolas Maduro's government in Caracas, Venezuela Reuters In pictures: The crisis in Venezuela Opposition supporters protest against Venezuela's President Nicolas Maduro's government during a rally in Caracas Reuters In pictures: The crisis in Venezuela Venezuela's Supreme Court abandoned measures to seize power from the opposition-controlled legislature after the moves drew international condemnation and raised pressure on President Nicolas Maduro. The president of Venezuela's National Assembly Julio Borges dismissed the court's gesture and told reporters that nothing had changed and the coup continued Getty Images In pictures: The crisis in Venezuela Venezuelans living in Peru and other protesters take part in a rally against Venezuelan President Nicolas Maduro's government, outside the Venezuela embassy in Lima, Peru Reuters In pictures: The crisis in Venezuela Venezuelans living in Peru and other protesters take part in a rally against Venezuelan President Nicolas Maduro's government, outside the Venezuela embassy in Lima, Peru Reuters

Rodriguez criticised Maduro for not holding a referendum before the Constituent Assembly election, as his predecessor Chavez had done in 1999.

“This is a country without government, this is chaos,” he told a news conference on Tuesday. “The people are left out... They (the government) are seeking solutions outside the constitution.” The government said pilot Perez was linked to Rodriguez. Neither men, nor representatives for them, could be reached immediately to comment on the accusations.