CARACAS, Venezuela — For years, the hulking reinforced-concrete U.S. Embassy here has been a target of Venezuela’s socialist leaders, who have expelled numerous senior American envoys. But the tension has perhaps never been higher than now, with authorities ordering diplomats out of the country by this weekend.

President Nicolás Maduro severed relations with Washington after the Trump administration on Wednesday recognized opposition leader Juan Guaidó as interim president. The U.S. government has defied Maduro’s order to vacate the embassy, saying it has Guaidó’s permission to stay. 

The standoff raised the possibility that Maduro could use force to expel the remaining diplomats. Already, his allies have suggested the government could cut off services to the building.

“They say they don’t recognize Nicolás,” Diosdado Cabello, the leader of Maduro’s socialist party, said on state television late Wednesday. “Okay. Maybe the electricity will go out in that neighborhood, or the gas won’t arrive. If there are no diplomatic relations, no problems.”

Late Thursday, the U.S. State Department announced it was removing nonessential personnel and diplomats’ families from Venezuela because of “the security situation” in the country. It did not specify how many would leave, but the U.S. government was expected to maintain a skeleton staff as a symbolic presence.

The scene outside the U.S. Embassy in Caracas, normally abuzz with visa applicants, was quiet Thursday, with embassy guards preventing most access. The embassy issued a bulletin calling on staffers to keep their children home from school, confine themselves to two neighborhoods in the capital and avoid public demonstrations. 

The embassy said it would remain open for U.S. citizens needing “emergency services” but canceled most visa appointments for Venezuelans.

State Department officials in Washington declined to provide details on the size of the U.S. staff in Caracas or any plans to protect the diplomats, with one official saying, “The full range of United States government resources are at the ready to ensure the safety and security of U.S. diplomats and their families.” The official spoke on the condition of anonymity due to the sensitivity of the situation.

But the diplomatic staff is small, because of the difficulty of getting Venezuelan permission for more personnel in recent years, officials said.

Among those expected to remain is the chargé d’affaires, James Story, a veteran Foreign Service officer originally from the small town of Moncks Corner, S.C., who has served in Brazil, Colombia and Mexico and held several jobs in anti-narcotics work at the State Department.

“Jimmy Story is one of the very best Latin Americanists we have,” said John Feeley, a Latin America expert and former U.S. ambassador to Panama who now works as a political consultant for Univision. He described Story as a charismatic “good old boy Southerner” with a quick sense of humor but added that he has “nerves of steel.” 

Tom Shannon, another longtime U.S. diplomat in Latin America who retired last year, said Story was an effective diplomat “with a kind of down-home touch.” 

“But that kind of country-boy appearance hides a toughness and determination that should not be underestimated,” he said.

Maduro declared Thursday that he would recall all Venezuelan diplomats from the country’s embassy in Washington, as well as from its seven consulates in the United States.

Even before the current standoff, life was difficult for U.S. diplomats in Caracas. Venezuela is one of the most crime-racked countries in the world, with an average of 63 violent deaths every day, according to analysts. The country is facing skyrocketing inflation and acute shortages of food and medicine as the economy implodes. On top of that, former U.S. officials said, Venezuelan authorities routinely harass diplomats in ways ranging from aggressive surveillance to sending pro-government crowds to taunt representatives of the United States when they appear in public. 

The U.S. government has had a tense relationship with Venezuela dating back to the presidency of Hugo Chávez, who accused Washington of backing a coup attempt against him in 2002, a charge the American government denied.

Over the years, Chávez and Maduro, his handpicked successor, have kicked out numerous senior U.S. diplomats, while alleging that Washington was preparing an invasion or anti-government violence — accusations the U.S. government denied. Those forced out include then-Ambassador Patrick Duddy, who was briefly expelled in 2008, and then-Chargé D’Affaires Todd Robinson, who was kicked out last year. The U.S. and Venezuelan governments have not exchanged ambassadors since 2010. 

As in most U.S. embassies, the mission in Caracas has U.S. Marine guards who live on the compound. The embassy is a sprawling 100,000-square-foot building in the Andean foothills, built to withstand terrorist attacks. But the diplomats do not live in the compound, relying on Venezuelan authorities for protection outside the embassy — just as other foreign diplomats in the country do. 

One official at the embassy, Scott Smith, posted publicly on Facebook that concern should be focused on the Venezuelan people suffering from the political and economic crises.

“Until the moment they force me to leave this beautiful place, I will do whatever I can — even if it’s the smallest of acts — to support these brave people and help them regain their voices,” Smith said in his Facebook post. “No one deserves what has been rained down upon them and I for one am proud to say that I will stand beside them — defiantly — until the end.”

Sheridan reported from Mexico City. Anthony Faiola in Rio de Janeiro, Rachelle Krygier in Miami, and Carol Morello and John Hudson in Washington contributed to this report.