Defense Minister Vladimir Padrino López said in a statement that some of the attackers had made away with weapons. He added that the military maintained its “unconditional support” of Mr. Maduro.

It was not the first time this summer that the government had faced rebellious officers. On June 27, a rogue faction of the Venezuelan police attacked the country’s Supreme Court and the Interior Ministry. The group released a video in which an officer named Oscar Pérez urged Venezuelans to “fight for their legitimate rights.”

No one was injured in that attack, but it made Mr. Pérez, who is also a part-time actor, a kind of folk hero among some of Mr. Maduro’s opponents. He has even appeared at an opposition rally.

The video on Sunday used a similar format to that of Mr. Pérez’s, a single spokesman standing in front of a group of silent men. The man identified as Captain Caguaripano said his men were not looking to stage a military coup, but rather a “civic and military action to re-establish constitutional order,” which would seek a “transitional government and free general elections.”

“The time has passed for secret pacts and deals between tyrants and traitors,” the man said.

He urged security forces to “display banners alluding to 350,” an apparent reference to Article 350 of the Venezuelan Constitution, which encourages people to “disown any regime, legislation or authority that runs counter to democratic principles.” Mr. Pérez also flew a similar banner from his helicopter on the day of his attack.

Captain Caguaripano has called for rebellion before. In 2014, during another round of protests against the president, the military issued an arrest warrant against him and around 30 other soldiers and police officers for an alleged plot to overthrow Mr. Maduro. In a video that year, Captain Caguaripano said the “armed forces cannot be and are not indifferent” to “a Castro-Communist system that now functions as the government of this country.”

It was unclear what the public reaction would be to the attack. Videos on social media showed small crowds in Carabobo waving Venezuelan flags and banging pots and pans in support of the rebel security forces.

The idea of military intervention to solve the Venezuelan political crisis has been floated nationally. On July 16, opposition parties held a protest vote against the constituent assembly, two weeks before Mr. Maduro’s planned election, an unofficial poll they said drew more than seven million people. Among the questions was a vaguely worded one asking whether Venezuela’s military should “defend” the current Constitution and “back the decisions” of the National Assembly, what some interpreted as taking the temperature for support for military intervention. The survey passed by a wide margin.