Venezuelan President Nicolas Maduro (C) speaks to a crowd of supporters at the Miraflores Palace flanked by his wife Cilia Flores (2-L) and Vice-President Delcy Rodriguez (R), as he holds up the document with which his government broke off diplomatic ties with the United States, during a gathering in Caracas on January 23, 2019. - Venezuelan President Nicolas Maduro announced on Wednesday he was breaking off diplomatic ties with the United States after his counterpart Donald Trump acknowledged opposition leader Juan Guaido as the South American country
PHOTO: LUIS ROBAYO/AFP/AFP/Getty Images
Venezuelan President Nicolas Maduro (C) speaks to a crowd of supporters at the Miraflores Palace flanked by his wife Cilia Flores (2-L) and Vice-President Delcy Rodriguez (R), as he holds up the document with which his government broke off diplomatic ties with the United States, during a gathering in Caracas on January 23, 2019. - Venezuelan President Nicolas Maduro announced on Wednesday he was breaking off diplomatic ties with the United States after his counterpart Donald Trump acknowledged opposition leader Juan Guaido as the South American country's "interim president." (Photo by Luis ROBAYO / AFP) (Photo credit should read LUIS ROBAYO/AFP/Getty Images)
Now playing
02:32
Understanding Venezuela's political crisis
TOPSHOT - Venezuelan President Nicolas Maduro holds a national flag during the closing of the campaign to elect a Constituent Assembly that would rewrite the constitution, in Caracas on July 27, 2017 on the second day of a 48-hour general strike called by the opposition.
Venezuela
PHOTO: FEDERICO PARRA/AFP/AFP/Getty Images
TOPSHOT - Venezuelan President Nicolas Maduro holds a national flag during the closing of the campaign to elect a Constituent Assembly that would rewrite the constitution, in Caracas on July 27, 2017 on the second day of a 48-hour general strike called by the opposition. Venezuela's opposition called for a nationwide protest on Friday in outright defiance of a new government ban on demonstrations ahead of a controversial weekend election. "The regime declared we can't demonstrate... We will respond with the TAKING OF VENEZUELA tomorrow," the opposition coalition, the Democratic Unity Roundtable, said Thursday on its Twitter account. / AFP PHOTO / Federico PARRA (Photo credit should read FEDERICO PARRA/AFP/Getty Images)
Now playing
01:46
US met with Venezuela officers plotting coup
Venezuelan citizens wait in line to cross to Ecuador at the Rumichaca international bridge in Ipiales, Colombia, on August 11, 2018. - The "unusual" increase in the migratory flow of Venezuelans, which reached 4,200 people a day, prompeted Ecuador to declare state of emergency in provinces bordering Peru and Colombia. (Photo by LEONARDO CASTRO / AFP)        (Photo credit should read LEONARDO CASTRO/AFP/Getty Images)
PHOTO: LEONARDO CASTRO/AFP/AFP/Getty Images
Venezuelan citizens wait in line to cross to Ecuador at the Rumichaca international bridge in Ipiales, Colombia, on August 11, 2018. - The "unusual" increase in the migratory flow of Venezuelans, which reached 4,200 people a day, prompeted Ecuador to declare state of emergency in provinces bordering Peru and Colombia. (Photo by LEONARDO CASTRO / AFP) (Photo credit should read LEONARDO CASTRO/AFP/Getty Images)
Now playing
01:56
Chaos in Venezuela triggers mass exodus
detonaciones desfile militar caracas maduro ruidos brk mirador mundial osmary hernandez_00004223.jpg
PHOTO: vtv
detonaciones desfile militar caracas maduro ruidos brk mirador mundial osmary hernandez_00004223.jpg
Now playing
02:18
Venezuelan President evacuated from stage
WASHINGTON, DC - APRIL 30:  (CHINA OUT, SOUTH KOREA OUT) U.S. President Donald Trump speaks during a joint press conference with Nigerian President Muhammadu Buhari at the Rose Garden at the White House April 30, 2018 in Washington, DC. The two leaders also met in the Oval Office to discuss a range of bilateral issues earlier in the day.  (Photo by The Asahi Shimbun via Getty Images)
PHOTO: he Asahi Shimbun via Getty Images
WASHINGTON, DC - APRIL 30: (CHINA OUT, SOUTH KOREA OUT) U.S. President Donald Trump speaks during a joint press conference with Nigerian President Muhammadu Buhari at the Rose Garden at the White House April 30, 2018 in Washington, DC. The two leaders also met in the Oval Office to discuss a range of bilateral issues earlier in the day. (Photo by The Asahi Shimbun via Getty Images)
Now playing
01:59
Trump asked advisers about invading Venezuela
venezuela prison riot joshua holt newton lkl_00004530.jpg
PHOTO: Facebook/Josh Holt
venezuela prison riot joshua holt newton lkl_00004530.jpg
Now playing
02:03
American jailed in Venezuela fears for life
 Carolina Wong and Jorge Salas sit with their daughter, Akira, before they leave Venezuela for Peru.
PHOTO: Khushbu Shah/CNN
Carolina Wong and Jorge Salas sit with their daughter, Akira, before they leave Venezuela for Peru.
Now playing
01:54
Family tearfully leaves Venezuela
Now playing
01:30
Dad remembers son killed in Venezuelan unrest
Demonstrators clash with the police during a rally against Venezuelan President Nicolas Maduro, in Caracas on April 19, 2017.
Venezuela braced for rival demonstrations Wednesday for and against President Nicolas Maduro, whose push to tighten his grip on power has triggered waves of deadly unrest that have escalated the country
PHOTO: JUAN BARRETO/AFP/Getty Images
Demonstrators clash with the police during a rally against Venezuelan President Nicolas Maduro, in Caracas on April 19, 2017. Venezuela braced for rival demonstrations Wednesday for and against President Nicolas Maduro, whose push to tighten his grip on power has triggered waves of deadly unrest that have escalated the country's political and economic crisis. / AFP PHOTO / Juan BARRETO (Photo credit should read JUAN BARRETO/AFP/Getty Images)
Now playing
01:54
Why Venezuelans are protesting
venezuelan flag
venezuelan flag
Now playing
01:19
Venezuela to US: Military action a 'crazy act'
Now playing
01:36
Panetta on Trump: This is not reality TV
PHOTO: Lilian Tintori
Now playing
02:09
Venezuela: Opposition leaders seized
Voters receive instructions by a Venezuelan Bolivarian National Guard officer outside a polling station during the election for a constitutional assembly in Caracas, Venezuela, Sunday, July 30, 2017.
PHOTO: Ariana Cubillos/AP
Voters receive instructions by a Venezuelan Bolivarian National Guard officer outside a polling station during the election for a constitutional assembly in Caracas, Venezuela, Sunday, July 30, 2017.
Now playing
00:56
Venezuelan candidate shot dead before election
Anti-government activists set up a barricade during protests of the election for a Constituent Assembly in Caracas on July 30, 2017. Deadly violence erupted around the controversial vote, with a candidate to the all-powerful body being elected shot dead and troops firing weapons to clear protesters in Caracas and elsewhere.
PHOTO: RONALDO SCHEMIDT/AFP/Getty Images
Anti-government activists set up a barricade during protests of the election for a Constituent Assembly in Caracas on July 30, 2017. Deadly violence erupted around the controversial vote, with a candidate to the all-powerful body being elected shot dead and troops firing weapons to clear protesters in Caracas and elsewhere.
Now playing
01:27
Violent protests over Venezuelan election
Masked opposition demonstrators take part in clashes with riot police ensuing an anti-government protest in Caracas, on July 26, 2017.
Venezuelans blocked off deserted streets Wednesday as a 48-hour opposition-led general strike aimed at thwarting embattled President Nicolas Maduro
PHOTO: FEDERICO PARRA/AFP/AFP/Getty Images
Masked opposition demonstrators take part in clashes with riot police ensuing an anti-government protest in Caracas, on July 26, 2017. Venezuelans blocked off deserted streets Wednesday as a 48-hour opposition-led general strike aimed at thwarting embattled President Nicolas Maduro's controversial plans to rewrite the country's constitution got underway. / AFP PHOTO / FEDERICO PARRA (Photo credit should read FEDERICO PARRA/AFP/Getty Images)
Now playing
01:49
Why Venezuela is in crisis
Venezuela caught in chaos newton dnt_00000000.jpg
Venezuela caught in chaos newton dnt_00000000.jpg
Now playing
01:46
Caught in the chaos in Venezuela
(CNN) —  

When Venezuelan President Nicolas Maduro secured another six-year term last May in an election widely seen as sham, the former Caracas bus driver declared himself “a better-prepared president and human being right now.”

But two weeks after being sworn in, the anointed successor of the late socialist firebrand Hugo Chavez is facing the biggest challenge to his turbulent political career.

A relative newcomer, opposition leader Juan Guaido, this week declared himself Venezuela’s acting president on a day of massive anti-government protests.

Several nations – including the United States and Canada – have officially recognized his presidency. Others, including China and Russia, still support Maduro.

A defiant Maduro appeared before a crowd of supporters outside the Miraflores presidential palace Wednesday to declare, “We will not surrender.”

President Nicolas Maduro, left, and opposition leader Juan Guaido.
President Nicolas Maduro, left, and opposition leader Juan Guaido.

Here’s how a country on a prolonged political and economic collapse reached a new low point.

A decade of decline

Through nearly a decade of mismanagement, Venezuela has squandered its profound oil wealth, leaving its economy in tatters and Latin America reeling from an unprecedented mass exodus of migrants in search of food and medicine.

The UN estimates as many as 3 million Venezuelans have left the country since 2014.

They are fleeing shortages of medicine, food and staples such as milk, flour and toilet paper – along with rolling blackouts, rising unemployment and soaring violent crime.

Over the years, Maduro continued the huge social welfare programs and price-control policies of Chavez, who was seen by many as a champion of the poor as he steered the country toward socialism.

Venezuela holds the world’s largest supply of crude oil, which once seemed to guarantee an endless flow of cash for the government. But plummeting oil prices in 2016 triggered an economic implosion that continues today. The oil-dependent country lapsed into political turmoil and economic misery, including hyperinflation and massive shortages of food and other necessities.

Venezuelans take to the streets in 2017

The country was rocked by deadly protests that year as opposition leaders faced off with Maduro and his backers.

Anti-government protesters accused Maduro of creating a dictatorship. They clashed on the streets with members of the armed forces.

Maduro was defiant and confrontational, calling the protesters “vandals and terrorists.”

The anti-Maduro factions were further infuriated when the government notified main opposition leader Henrique Capriles in April 2017 that he was banned from political work for 15 years.

Demonstrators clash with riot police during an anti-government protest in Caracas on July 20, 2017.
PHOTO: RONALDO SCHEMIDT/AFP/AFP/Getty Images
Demonstrators clash with riot police during an anti-government protest in Caracas on July 20, 2017.

That summer, the United Nations’ human rights office accused Maduro’s regime of excessive force and arbitrarily detaining thousands of people amid months of sometimes deadly anti-regime protests.

By that time, more than 120 people had died in protest-linked incidents. Critics accused Maduro of illegitimately consolidating power, including stacking the Supreme Court with loyalists and holding an election for a new legislative assembly packed mostly with his backers.

Maduro’s disputed re-election

When Maduro was re-elected in May 2018, many eligible voters boycotted the vote. The country’s electoral board placed turnout at a lackluster 46%. That was far below the 80% rate in 2013, when Maduro rose to power after the death of the popular Chavez.

The United States said it would not recognize the election results. And even before the polls opened, the European Union and several of Venezuela’s Latin American neighbors were warning of an unfair election.

Venezuelan President Nicolas Maduro addresses supporters after election results on May 20, 2018 in Caracas.
PHOTO: FEDERICO PARRA/AFP/AFP/Getty Images
Venezuelan President Nicolas Maduro addresses supporters after election results on May 20, 2018 in Caracas.

An alliance of 14 Latin American nations and Canada declared the vote illegitimate. They included Argentina, Mexico, Brazil, Chile, Colombia, Panama, Paraguay, St. Lucia, Guyana, Peru, Honduras, Guatemala and Costa Rica.

Maduro was sworn in earlier this month, eight months after the contested election.

The International Monetary Fund predicts inflation will hit 10 million percent in 2019. The Maduro regime has continually raised the minimum wage, fueling ever more inflation, so every raise actually buys Venezuelans less and less each month.

Maduro blamed what he calls US economic terrorism for Venezuela’s ills. Meanwhile the Trump administration has sought to pressure Maduro with targeted financial sanctions.

The emergence of Juan Guaido

The little-known politician has been a leader of the opposition and head of the National Assembly for merely three weeks. Still, the 35-year-old has managed to tap into the frustrations of the populace and quickly energize them against Maduro.

He became politically active while studying industrial engineering at the Universidad Católica Andrés Bello in Caracas.

Guaido was among protesters who blamed Chavez for what they said were his attempts to control the press.

He was also part of a group of young leaders who founded a political party in 2009 called Voluntad Popular – Popular Will – along with his mentor, Leopoldo Lopez, one of the best-known faces of the opposition. Lopez is now under house arrest.

The party mission was to combat poverty and to restore democracy.

Juan Guaido speaks during a mass opposition rally in Caracas on January 23.
PHOTO: FEDERICO PARRA/AFP/AFP/Getty Images
Juan Guaido speaks during a mass opposition rally in Caracas on January 23.

Guaido emerged from virtual political obscurity when he was named president of the National Assembly on January 5. He joined the legislature in 2011, serving as an alternate until he was elected in 2016 as representative for the state of Vargas, a position he currently holds.

On Wednesday, Guaido declared himself acting president in a dramatic swearing-in before throngs in Caracas.

He said the day marked the beginning of an unstoppable movement to restore independence and democracy. He also called for new elections.

“We know this will have consequences,” he said.

Sporadic clashes erupted between security forces and protesters. News footage showed National Guard members launching tear gas canisters at demonstrators.

Ten people died in protests across the country on Wednesday, Marco Antonio Ponce, executive director of the local NGO Observatorio Venezolano de Conflictividad, told CNN.

CNN has not independently verified the death toll and no official figures have been released by the government.

Confusion over Venezuela’s political future

What happens next remains uncertain.

Venezuelans find themselves with two declared leaders, unrest in the streets and foreign powers divided about who to recognize as the legitimate president.

Hours after President Donald Trump recognized the Guaido presidency, a defiant Maduro gave US diplomats 72 hours to leave the country.

Venezuelan demonstrators set up a barricade during a protest against the government of President Maduro on January 23.
PHOTO: YURI CORTEZ/AFP/Getty Images
Venezuelan demonstrators set up a barricade during a protest against the government of President Maduro on January 23.

The embattled Maduro wore his presidential sash during an appearance before Venezuela’s Supreme Court on Thursday. He announced in a speech aired live on state broadcaster VTV that he was closing the Venezuelan embassy and all consulates in the US and recalling all diplomatic staff.

The speech came hours after US Secretary of State Mike Pompeo urged the Organization of American States to support Guaido’s interim presidency. He referred to Maduro’s regime as “now defunct” and “illegitimate.”

Venezuelan Defense Minister Vladimir Padrino Lopez also appeared on state television Thursday, surrounded by his high command, to pledge his support to Maduro. He called the developments of the previous day “horrifying” and described the allegiance of the armed forces for the president as “total.”

“We swore to die for our homeland, for our Venezuela, and we are going to comply,” he said.

Meanwhile, UN Secretary-General Antonio Guterres has called for dialogue.

And it remains to be seen whether Maduro can maintain complete control of the armed forces. Guaido has offered amnesty to all service members who break with Maduro.

A day after presenting Maduro with the biggest political challenge of his presidency, Guaido mostly stayed out of the public eye.

CNN’s Flora Charner contributed to this report.