A chaotic political standoff with international diplomatic implications began unfolding quietly weeks ago on a leafy side street in the upscale Georgetown neighborhood of Washington, as a group of American activists moved into the five-story Venezuelan Embassy and made themselves at home.

They were there, they said, to keep the United States from going to war.

With some 100 Venezuelan diplomats still working inside during the day, the activists from Code Pink and other antiwar groups brought their things to spend the night, sleeping on couches to keep the building occupied around the clock. They said they were guests, invited by the government of President Nicolás Maduro, and their mission was to oppose any American military intervention in the troubled South American nation.

Appointees of Juan Guaidó, the opposition leader recognized by the United States and some 50 other countries as Venezuela’s interim president, had pledged to take over the embassy, a move those now occupying the facility fear could lead to a reciprocal siege of the American Embassy in Venezuela, and an armed conflict.

Late last month, local Venezuelans who support Mr. Guaidó learned of the occupation and descended on the building, demanding that the activists, whom they view as unlawful trespassers, get out.