BRASÍLIA — Venezuela’s embassy in Brazil’s capital became the scene of a tense and at times violent standoff on Wednesday that lasted more than 12-hours and began when a group of Venezuelans seeking the ouster of President Nicolás Maduro tried to gain control of the diplomatic compound.

Representatives of Juan Guaidó, a Venezuelan politician who seeks to depose Mr. Maduro and proclaimed himself the rightful leader of Venezuela in January, entered the diplomatic compound saying they were doing so at the invitation of some of the diplomats assigned there by the Maduro government. Around 5 p.m. Mr. Guaidó’s supporters left the embassy, according to local press reports in Brasília.

The confrontation lasted more than 12 hours, and led to screaming and shoving matches at the gate that drew a large police presence. It played out as Brazil was hosting the Chinese, Indian, Russian and South African leaders for a summit of an alliance known as BRICS.

The head of the mission, denounced the entry of Mr. Guaidó’s supporters as an invasion and a breach of diplomatic norms.