Venezuelan President Nicolás Maduro pauses during a news conference in Caracas on Dec. 12. Maduro will be sworn in Thursday for a second six-year term.

President Nicolás Maduro is set to be sworn in for a second term Thursday at a moment when there is little for him to celebrate.

His country is collapsing. There are signs of dissent in his inner circle. Socialist Venezuela is increasingly isolated, and its neighborhood has never been more unfriendly.

And yet, after an election in May tainted by allegations of fraud, Maduro begins his next six-year stint seemingly in a position of relative strength at home. According to Félix Seijas, head of the Caracas-based polling firm Delphos, the president remains extraordinarily unpopular, but so does his opposition — perhaps even more so.

Massive pro-democracy protests filled Venezuela’s streets for months in 2017. But after a brutal government response left more than 100 people dead, public demonstrations are now largely confined to smaller, more pragmatic rallies protesting water shortages and power blackouts.

“It is risky to predict 2019 will mark the end of Maduro’s authoritarian rule,” said Michael Shifter, president of the Inter-American Dialogue, a Washington-based think tank. “Some have been saying his days are numbered since he came to power nearly six years ago. For various reasons, he has proven to be more resilient than many expected.”

In 2018, many Venezuelans fled a crumbling economy. The man critics blame for the crisis, President Nicolás Maduro, is slated to rule for six more years. 

Maduro, the anointed successor of left-wing firebrand Hugo Chávez, who died in 2013, is nevertheless entering a far more precarious era of leadership.

According to a U.S. intelligence official who spoke on the condition of anonymity to discuss ­sensitive matters freely, Maduro’s defense minister, Vladimir Padrino López, told the president last month to step down or accept his resignation — a threat he has yet to act on.

Brazil’s new pro-Trump leader, President Jair Bolsonaro, has followed the United States in taking a tough stance against Maduro. Given the already hard line adopted by Colombia, Venezuela is now sandwiched between hostile powers and is facing the threat of new sanctions or worse.

“Bolsonaro wants to be seen as the toughest opponent of Chavismo in South America,” said ­Matias Spektor, a professor of international relations at the ­Getulio Vargas Foundation in Sao Paulo, Brazil, referring to Chávez’s leftist-nationalist ideology. “He’ll likely rally for support from other countries in the region to take action against Venezuela. He could attempt to impose sanctions on individuals or try to build a coalition to refer Maduro to the International Criminal Court.”

Ratcheting up the pressure, the Treasury Department on Tuesday added to the U.S. sanctions list of current and former Venezuelan officials, citing seven people and two dozen corporate entities for an alleged currency scheme that enriched Maduro administration insiders.

In a joint news conference with Secretary of State Mike Pompeo last week, Ernesto Araújo, Bolsonaro’s foreign minister, said that “all of the world’s countries must stop supporting [Maduro] and come together to liberate Venezuela.”

“There’s a coup against me, led by Washington,” Maduro asserted. He added: “I tell our civilians and our military to be ready. Our people will respond.”

Maduro’s domestic opposition has been divided and mismanaged. But there are some indications that its leaders may use this week’s swearing-in as an opportunity to reunite and try to regain muscle.

The opposition, said legislator Juan Pablo Guanipa, “will relaunch and seek Maduro’s ouster with a clearer strategy and renewed credibility.” He said leaders have been discussing how to go about it, with some wanting to name a parallel government at the opposition-led National Assembly, while others prefer to lobby for international pressure and call for street protests to eventually force free and fair elections.

Observers say that a scenario in which the military intervenes to hand power to an opposition-led government is unlikely any time soon. There are signs that parts of the military are unhappy, with desertions rising and hundreds of officers fleeing the country. But the institution is under constant surveillance, with disloyalty punished harshly.

Human Rights Watch on Wednesday released a reportdocumenting growing cases of arrests and torture of suspected anti-Maduro military officers and their families.

Potentially more likely, experts say, would be an Arab Spring-like scenario in which an individual protester, such as the Tunisian street vendor who set himself on fire to protest official harassment, becomes the catalyst of a general uprising. Alternatively, rifts within the ruling party could lead to the replacement of ­Maduro by another pro-Chávez leader.

On the streets of Caracas, the capital, few sounded optimistic this week.

“Everyone is desperate, and our situation is crazy, but Maduro wants to ignore it and stay,” said Morelia Salazar, a 23-year-old trying to find reasonably priced food in the city center. “Since he arrived, everything has gotten so bad that we can barely afford to feed ourselves at this point.”

“Nobody has yet won a bet predicting Maduro’s departure,” said Eric Farnsworth, a former U.S. diplomat who is now vice president of the Council of the Americas, a business group.

Faiola reported from Miami. Ellen Nakashima in Washington contributed to this report.