A stolen police helicopter fired grenades at government buildings in Venezuela overnight in what the country's president characterized as an attempted coup — a remarkable new flashpoint in a deepening crisis.

The oil-rich nation has been debilitated by months of deadly anti-government protests, a failing economy and shortages of food and medicine.

President Nicolás Maduro blamed the air assault on a rogue police pilot named Oscar Perez, who allegedly escaped the scene and was being hunted by authorities. No one was injured.

"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, according to The Associated Press. "They could have caused dozens of deaths."

However, some of Maduro's opponents claimed the episode might have been staged to justify the government's repression of its critics. Opponents accuse the president of being a dictator and of pushing through various measures to consolidate power into his own hands.

Police pilot Oscar Perez released a video on his Instagram feed after the helicopter attack. REUTERS TV / Reuters

It was impossible to immediately verify either side's claims surrounding Tuesday's chaotic events.

The government said the helicopter fired 15 shots against the Interior Ministry headquarters during a reception celebrating national journalist's day, the AP reported.

According to this account, the chopper then flew to the pro-government Supreme Court and fired four grenades.

Inside the court, magistrates were issuing a number of rulings further hemming in Venezuela's opposition.

Around the same time of the attack, a man identified as Oscar Perez, the police pilot, posted several videos to his Instagram account saying he represented a coalition of military, police and civilian officials opposed to the "criminal" government.

Flanked by four people wearing camouflage jackets, helmets, ski masks and holding what appeared to be assault rifles, he said "this fight is ... against the vile government. Against tyranny," according to a Reuters translation.

Pictures of a blue police helicopter carrying an anti-government banner also appeared on social media.

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

The incident capped a chaotic 24 hours for Venezuela, with widespread looting in the coastal city of Maracay on Monday night and punch-ups between national guardsmen and opposition lawmakers who were trying to enter the National Assembly earlier Tuesday.

But the country's problems run far deeper than the events of this week. Here's the context:

Why is Venezuela in a mess?

Despite having the world's largest oil reserves, Venezuela is suffering from a deep recession and hyper-inflation.

Prices rose by 800 percent in 2016, with the International Monetary Fund predicting inflation could hit 2,200 percent by the end of 2017. Meanwhile, the economy shrunk by 18.6 percent last year, according to Reuters.

A man walks down the aisle of a destroyed grocery store in the capital Caracas. Miguel Gutierrez / EPA

At the same time, food and medicine shortages are creating a humanitarian emergency. Shoppers, forced to wait in long lines to buy basic supplies, are often met by empty grocery shelves. Hospitals are suffering from acute shortfalls of everything from antibiotics, to basic sanitation equipment like medical gloves and soap.

The current protests were triggered by a Supreme Court decision to strip power from the National Assembly, the opposition-held Congress. This move was widely thought to be aimed at concentrating power in the hands of Maduro's increasingly unpopular government.

For the past three months, people — from students to housewives and retirees — have taken to the streets to express their outrage, confronting National Guard troops armed with tear gas and water cannons.

In May, NBC News spoke with Roberto, a 51-year-old Caracas resident who owns his own electrical supplies business. He explained why his fellow Venezuelans were taking to the streets.

"It is common to find people scavenging for food at garbage dumps and everywhere people are eating off garbage cans," said the father-of-one who spoke on condition that his last name was not used out of fear of government reprisal. "People are starving. You see misery everywhere."

PHOTOS: In Venezuela, Upheaval Shows No Signs of Slowing Down

He said he sells "20 times less" than he used to and is just living off savings, which he fears may run out soon. Despite being tear gassed at recent demonstrations, he said he will continue to march because he has no choice.

"A lot of people have left the country, those that can have gone overseas. But for those like me that are still here, all we can do is fight," Roberto said. "We are fighting for free and honest elections, we want to recover democracy."

An opposition activist offers a flower to members of Venezuela's national guard during a march in Caracas on May 6. JUAN BARRETO / AFP - Getty Images

Gustavo Arnavat, senior adviser at the Center for Strategic and International Studies, told NBC News that these conditions "have produced a political and constitutional crisis that are precipitating the complete collapse of the state."

"Even former supporters of Hugo Chávez are starting to turn against the government and policies of president Maduro," he added, referring to the current president's predecessor and father of "Chavismo" — a Latin American left-wing ideology following the principles of Simon Bolivar who fought for colonial independence from Spain.

What happened to Chávez?

For decades, the country was controlled by a small elite and there was extreme disparity between the rich and poor.

Late president Chávez was elected in 1999 on the promise that he would share Venezuela's immense oil wealth with the poor — the country derives 95 percent of its export earnings from petrochemicals.

Fueled by high oil prices that went from $10 barrel when he took office, to over $100 when he died of cancer in 2013, Chávez enacted a series of policies aimed at redistributing wealth. His government nationalized parts of the country’s economy — from oil rigs to telecommunications firms to banks — forcing many companies to flee the country.

As the self-proclaimed leader of the "Bolivarian Revolution," Chávez frequently railed against the U.S. — famously calling President George W. Bush "the devil" during a speech at the United Nations General Assembly in 2006.

President Nicolas Maduro stands next to a placard depicting late leader Hugo Chavez during a rally in Caracas. CARLOS BECERRA / AFP - Getty Images

Maduro, Chávez’s hand-picked successor, was elected by a thin margin in 2013, but came to power as oil prices plummeted by more than 50 percent.

"After Chávez’s death, Maduro has just continued and accelerated the authoritarian and totalitarian policies of Chávez," said Shannon K. O'Neil, senior fellow for Latin American Studies at Council on Foreign Relations.

To analysts, the current emergency can be attributed to the economic crisis brought on by the fall in crude oil prices — which today are trading at about $46 a barrel — coupled with the gradual undermining of the country’s democratic institutions.

"If oil was still at $100 barrel, we would not be having this conversation," Arnavat said.

PHOTOS: Venezuela’s Opposition Activists Protest in Caracas as Unrest Enters Fourth Week

What Maduro has chosen to do with the country's reduced income precipitated the current troubles, according to O’Neil.

"There has been a conscious choice by the government to use the money it has to pay off international debts and not to pay for food and medicine," she added.

How is Maduro hanging onto power?

This week Maduro called for an assembly to rewrite Venezuela’s constitution.

Opposition leaders say this is just a bid to stay in power by putting off regional elections scheduled for this year and a presidential vote in 2018. Opinion polls have suggested the socialists would lose both.

Maduro has also moved several prominent military officers into positions of power within the government, a move O’Neil says is meant to "solidify their support so they don’t turn on him."

The government has also steadily curtailed democratic freedoms — restricting the free press, imprisoning opponents and preventing them from running for office.

Why should Americans care?

For one thing, the Venezuelan crisis could spill over its borders and undermine neighboring countries and the continent as a whole.

"One of the successes of the Western Hemisphere is that almost all the countries — Cuba excepted — are democracies. And that’s a model Americans believe in," said O’Neil.

"That matters to the U.S.," she added.

A disintegration of the government will also reverberate economically and in terms of security.

"A collapse of the state in Venezuela will produce financial, economic, regional and security risks for the United States,” said Arnavat, who also served as U.S. executive director at the Inter-American Development Bank, the largest source of development financing for Latin America and the Caribbean, during the administration of President Barack Obama.

There could also be a huge impact on oil prices in the U.S. If the government truly collapses, it could negatively impact oil production in Venezuela, a founding member of OPEC, which in turn could mean higher prices at the pump in the U.S. and worldwide.

There is also a fear that if there is a power vacuum, the country could become a safe harbor for terrorists and drug traffickers — which could have a destabilizing effect in the region and potentially even create a migration crisis in neighboring countries.

"From a humanitarian perspective, and given the presence of several hundred thousand residents in the U.S. of Venezuelan origin, the vast majority of which Iives in Florida, there will be an urgent call for action for the U.S. to step in and provide assistance," said Arnavat.

What's the U.S. stance on Venezuela?

The State Department condemned the dissolution of Venezuela's National Assembly as "a serious setback for democracy" and the Trump administration is looking to put pressure on Maduro by considering stronger economic sanctions.

A group of Republican and Democratic senators also introduced a bill in early May that would provide $10 million in humanitarian aid to the country, require the State Department to coordinate a regional effort to ease the crisis, and ask American intelligence to report on the involvement of government officials in corruption and the drug trade.

PHOTOS: Venezuelans Mount Pressure on Government as Protests Intensify

"It may be tempting to note that the administration has more important domestic and foreign priorities, but if Venezuela collapses, it will become a major priority," Arnavat said. "And the ability of the U.S., as the world's and region's leader, to manage the crisis will establish a precedent and be part of President Trump's legacy."

How bad can it get?

"So long as the economic crisis and human suffering remains unabated, and no political solution is reached, things can only get worse," according to Arnavat.

A demonstrator catches fire during clashes with police at a protest against President Nicolas Maduro in the Caracas on May 3. Ronaldo Schemidt / AFP - Getty Images

Dr. Jennifer McCoy, a professor at Georgia State University who specializes in Latin American politics, also said the situation could get "much worse" and warned that "things could spiral very quickly if people don’t see significant electoral change."

She pointed out that while the country has historically been very peaceful, Venezuelans are very well armed — particularly because of the violent crime wave that hit the country in recent years.

The U.S. Overseas Security Advisory Council, which aims to create effective security communication between American private sector interests worldwide and the State Department, called it "one of the deadliest countries in the world" in its 2017 Crime and Safety Report.

What’s next?

What happens now will depend on the people on the streets, "but also on the military," McCoy said.

She added that Maduro’s call for a constitutional rewrite "looks like a gambit by the president to calm the current unrest in the streets and postpone elections that he fears he will lose."

An opposition demonstrator wounded during clashes with riot police is carried away by medics during a protest in Caracas on May 3. Juan Barreto / AFP - Getty Images

"The next step will depend on how big of an outcry there is in Venezuela and if the military continues to support the president or if there is international outcry."

CFR's O'Neil warned that a spiral downward could come swiftly.

"It’s a slow moving crisis — which can last longer than you think, but when they end, they end quickly," she said.

Follow NBC Latino on Facebook, Twitter and Instagram.