CARACAS, Venezuela — Members of the Venezuelan National Guard were detained in the capital early Monday, the military said, after online videos showed a group of soldiers pledging allegiance to an opposition leader seeking to oust President Nicolás Maduro.



The soldiers’ apparent defiance at a military installation in the western Caracas neighborhood of Cotiza occurred days after opposition leaders offered amnesty to members of the armed forces who turned their backs on the government and helped establish a transitional government that would convene fair elections.

The opposition leaders have called for nationwide demonstrations on Wednesday, which they hope will show that their bid to replace Mr. Maduro has widespread support.

The United States and several governments in the region have backed the opposition’s plan, but leaders of the movement acknowledge that getting the armed forces to flip will be the toughest hurdle.