After about 36 days inside the Venezuelan Embassy, activists on Thursday ran out of time.

Federal law enforcement officers entered the embassy about 9 a.m. at the behest of Venezuelan opposition leader Juan Guaidó to remove and arrest the final four demonstrators inside, ending a weeks-long standoff between protesters on opposite sides of the South American country’s political crisis.

The Venezuelan Embassy in Washington’s Georgetown neighborhood has been the site of dueling protests between backers of embattled President Nicolás Maduro and supporters of Guaidó, who has been recognized by the United States and about 50 other nations as the country’s interim president.

Carlos Vecchio, the Guaidó-appointed ambassador recognized by the U.S. government, said his diplomatic mission would take control of the embassy Thursday evening.

“The usurpation has ended,” he said in a statement in Spanish. “It has taken time and effort, but we have complied with the Venezuelan people. Infinite thanks to the Venezuelan diaspora for their sacrifice. Next liberation: Venezuela.”

Earlier this week, Vecchio requested U.S. assistance in removing activists living inside the embassy and gave federal law enforcement officers permission to enter, a State Department spokesman said. U.S. Magistrate Judge G. Michael Harvey later issued a warrant for the demonstrators’ arrests.

But Carlos Ron, deputy foreign minister for the Maduro government, tweeted Thursday that U.S. officials entering the building “is an unlawful breach of the Vienna Convention,” an international treaty that created a legal framework for diplomacy between countries.

Four people, “including members of a group called Code Pink, individuals calling themselves the Embassy Protection Collective, and members of a group called the Popular Resistance” were arrested for interfering with the State Department’s protective functions, according to the agency.

Code Pink organizers identified the arrested demonstrators as Kevin Zeese, Margaret Flowers, Adrienne Pine and David Paul. They are scheduled to appear in federal court Friday, according to the U.S. attorney’s office.

The four had been among the occupation’s most stalwart participants, organizers said, joining the demonstration in early April and refusing to leave after an eviction notice was posted Monday to the embassy’s door.

The four demonstrators had said they would leave if a diplomatic agreement was reached in which third-party countries — like Switzerland — agreed to take charge of the Venezuelan Embassy in Washington and the U.S. Embassy in Caracas. This, activists said, would guarantee the security of both embassies in the midst of an international conflict.

At its peak, the Code Pink-led occupation brought as many as 50 people into the building.

“We are prepared to stay for as long as it takes,” Zeese said in late April.

Flowers added, “They’ll have to carry me out.”

On Thursday, police brought the demonstrators out in handcuffs.

Mara Verheyden-Hilliard, co-founder of the Partnership for Civil Justice Fund, which has provided legal assistance to the activists, said that “federal law enforcement officials broke into the embassy” on Thursday.

“Instead of leaving the government of Venezuela up to the people of Venezuela, you now have the U.S. government deciding for the people of Venezuela who their leadership will be, and handing over an embassy compound to their designated representative,” she said after the arrests.

Federal law enforcement officers, including several in fatigues wearing tactical gear, entered the building through a back door and conducted a sweep with police dogs.

After more than an hour, police brought the activists into a driveway hidden from the view of protesters and the news media gathered on 29th Street NW. Down the block, a resident of the James Place Condominium apartments chanted “Code Pink, go home” into a megaphone.

For weeks, Guaidó supporters congregated outside the embassy to demand the demonstrators leave the building. None of the occupiers were Venezuelan — a fact that riled members of the Venezuelan community in Washington.

“This is first and foremost a strong rejection of Nicolás Maduro, and to see a group of Americans, an NGO, support him so strongly just got a visceral reaction from us,” said pro-Guaidó demonstrator Dilianna Bustillos. “We wanted to get out here and say what they were saying out the embassy window, our embassy’s window, did not represent the wishes of the Venezuelan people.”

The ongoing and, at times, explosive confrontation between activists became a proxy struggle for control over the South American country’s diplomatic mission.

“Of course, all of us Venezuelans feel that the embassy is ours. It’s not just a building — it represents the fight for democracy,” Matthew Burwick, a pro-Guaidó Venezuelan who has demonstrated for weeks, said in Spanish. “It’s a small little piece of Venezuela.”

Protests inside and outside continued nonstop for nearly three weeks, but leftist demonstrators from groups such as Code Pink, the Answer Coalition and Popular Resistance began living inside long before counterdemonstrators began to protest.

Members of Code Pink were invited by Maduro government officials to stay in the building and “protect it” from attempts to enter by U.S. forces or Guaidó appointees, Code Pink co-founder Medea Benjamin has said.

On April 30, anti-Maduro demonstrators converged to protest Code Pink’s presence inside. They set up camp with tents, canopies and food stations so they, too, could be at the embassy round-the-clock.

Members of the group patrolled the building’s entrances and exits, at times physically blocking Code Pink supporters’ efforts to enter the building or deliver supplies such as food and water to demonstrators inside.

Each side has accused the other of violence and harassment.

Police have arrested at least 10 people since May 1, many of whom were charged in connection with assaults or “throwing missiles” — in many cases, a reference to food items launched past police barricades and the raised hands of Guaidó supporters.

As the protest continued, conditions inside the embassy declined.

Last week, protest organizers said Pepco shut off electricity to the building at the direction of Guaidó-appointed diplomats recognized by the U.S. government.

On Monday, officials posted a notice demanding the occupiers vacate the embassy. Several demonstrators complied. On Tuesday, those who remained said they were running out of food and water. That same day, police warned activists via megaphone they needed to leave “immediately.”

As federal authorities loaded Flowers, Pine, Paul and Zeese into police vehicles and drove them away Thursday, pro-Guaidó protesters gathered outside with Venezuelan flags, holding signs declaring “Venezuela libre!” (“free Venezuela”).

They cheered as police drove past and shouted a “thank you” to officers. Then, they began to sing the national anthem of Venezuela.

D.C. police officers, who had been securing the perimeter of the building and nearby streets since the dueling protests began to intensify three weeks ago, closed off 30th and 29th streets NW for nearly two hours.

Police spokesman Dustin Sternbeck said the department will ask the federal government to reimburse costs associated with helping federal authorities. Sternbeck said he didn’t have an estimate on the costs.

Both Code Pink and Guaidó supporters said their fight for the future of Venezuela would continue, although there might be a change of venue.

“This has been one of our protest sites for as many years as I can remember. It’s no longer going to be necessary for us to protest in front of our embassy,” said Robert Nasser, a Guaidó supporter and member of Venezuelan activist group Lucha Democratica. “But there is still work to be done. Our voice can still be heard, so we’re looking at other actors to whom we should direct our protest energy.”

Peter Hermann contributed to this report.