Four activists who were forcibly removed from the Venezuelan Embassy after living there for more than a month were released from jail Friday after appearing in federal court on a misdemeanor charge of interfering with State Department diplomatic protective functions.

Prosecutors filed the charge, punishable by up to a year in prison, by criminal information, a charging document used when defendants waive their right to an indictment that typically means they intend to enter a plea deal.

Margaret Flowers, 56; Adrienne Pine, 48; David Paul, 69; and Kevin Zeese, 63, were the last of about 50 left-wing demonstrators who, since April 10, had spent time living inside the troubled South American country’s embassy in Washington’s Georgetown neighborhood.

Federal law enforcement officers arrested the four activists Thursday morning, after prying open the embassy door at the request of Venezuelan opposition leader Juan Guaidó, who is recognized by the United States and about 50 other nations as the country’s interim president.

At the activists’ initial court appearance, U.S. Magistrate Judge G. Michael Harvey of the District released the defendants on personal recognizance, on condition they stay away from designated Venezuelan officials and representatives, 10 diplomatic properties and obtain preapproval for foreign travel.

“I don’t want you to be stumbling into one of these properties,” Harvey warned the defendants, still dressed in casual clothes from their arrests.

Activist Margaret Flowers is arrested after occupying the Venezuelan Embassy on Thursday. (J. Lawler Duggan for The Washington Post)

Assistant U.S. Attorney Danielle Rosborough said the government requested the defendants give up their passports. But defense attorneys for the group — which included a medical doctor, an American University anthropology professor set to travel to Iraq next month, a master’s degree holder and a lawyer — successfully argued they were not flight risks.

“These are not people who are afraid of the court system. . . . I believe they want their day in court,” said assistant federal defender David Bos. “I can’t image they want to flee the country.”

The defendants didn’t enter a plea, but Harvey set a court date for June 12, which also is the deadline for them to decide whether to keep court-appointed counsel or seek other attorneys.

Code Pink, the left-wing activist group known for its theatrical and provocative protests that frequently result in arrests, had been invited to bring its members into the embassy in early April by Venezuelan President Nicolás Maduro, who tasked the group with “protecting” the building from U.S. forces or Guaidó’s interim government.

Venezuelans celebrate outside the embassy as four activists who occupied the building for more than a month were arrested Thursday. (J. Lawler Duggan for The Washington Post)

More than two dozen Code Pink supporters packed the courtroom Friday, wearing bubble-gum-colored T-shirts and offering a show of support for the activists, who spent Thursday night in jail.

“They’re in good spirits,” said Mara Verheyden-Hilliard, co-founder of the Partnership for Civil Justice Fund, which has provided legal assistance to the activists. “They are very disappointed to see the U.S. government take these steps that they see as a destabilization effort.”

The four defendants were greeted outside the courthouse by supporters chanting, “No coup! No war! No sanctions anymore!”

“We will have our day in court and we think we will be victorious,” Zeese said. “That’s the only night in jail they’re going to get from us.”

Flowers, Pine, Paul and Zeese sought to encourage the State Department to appoint a third-party nation to protect the Venezuelan Embassy while the leader of the country’s government remains in dispute, Verheyden-Hilliard said.

But the United States recognizes Guaidó’s opposition government as that country’s legitimate leader, so his handpicked ambassador took over the embassy Thursday night.

“It turns logic on its head,” Verheyden-Hilliard said. “They were actually protecting and standing up for the Vienna Convention, which is exactly what the State Department is supposed to be doing. Instead, they were charged with interfering with its mission.”

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

Federal law enforcement officers entered the embassy about 9 a.m. Thursday after surrounding the building and closing off access points to the news media, protesters and passersby. The arrests were quick, organizers said, with officers entering through the back door.

Zeese opened a third-story window after officers entered and called out, “They’re about to arrest us!” before he was taken into custody.

The arrests ended a weeks-long standoff between protesters on opposite sides of the South American country’s political crisis who had conducted round-the-clock protests for nearly three weeks.

After learning that Code Pink and other left-wing organizations, including the Answer Coalition and Popular Resistance, had taken up residence inside the embassy, Venezuelan and Venezuelan American supporters of Guaidó gathered outside to demand the demonstrators get out. None of the occupiers were Venezuelan — a fact that riled members of the Venezuelan community in Washington.

The confrontation between pro-Maduro and pro-Guaidó protesters became a proxy struggle for control over the South American country’s diplomatic mission. More than a dozen people, including the four removed Thursday, were arrested while protesting, according to federal officials.

Carlos Vecchio — the Guaidó-appointed ambassador recognized by the United States — requested help from the State Department early in the week to clear the embassy of activists who refused to leave, even after electricity was cut and an eviction notice was placed on the door Monday.

On Thursday evening, he held a celebratory news conference on the embassy’s steps, announcing plans to turn the embassy into a “center for collecting humanitarian aid” for Venezuela. As he spoke, supporters chanted “sí, se pudo” — “yes, we did.”

“We have recovered this building, the next building will be the Miraflores Palace, and we’ll be there with all our people,” Vecchio said, referring to the presidential palace in Caracas.

Code Pink members didn’t plan to stay away for long. They organized a Saturday protest outside the embassy, followed by the Rev. Jesse Jackson returning Sunday with spiritual leaders to host a vigil for peace.

Justin Wm. Moyer contributed to this report.