BRASILIA, Brazil (AP) -- Troops guarded federal buildings in Brazil's capital early Thursday as the president struggles to hang onto power amid an outcry over corruption allegations and after clashes between police and protesters demanding his resignation forced the evacuations of several ministries.
With tens of thousands of demonstrators in the streets and lawmakers in Congress calling for his ouster, President Michel Temer ordered soldiers deployed in Brasilia on Wednesday. The Defense Ministry said 1,500 soldiers were being used.
What began as small scuffles between police and protesters who tried to jump a cordon mushroomed into a series of confrontations in which officers fired tear gas and pepper spray to contain the crowd. A fire broke out in the Ministry of Agriculture, and protesters broke windows and doors at other ministries.
Local media captured video images of military police firing pistols into the air. The Secretariat of Public Security issued a statement late Wednesday saying it would investigate the weapons firing, saying that "this procedure is not used in protests." Earlier, it said one person had been injured by a bullet but give no information on who fired the shot.
Some government agencies were evacuated because of the violence, the president's office said.
In a brief national address during the unrest, Defense Minister Raul Jungmann said troops were being sent to guard the presidential palace and other federal buildings. The weeklong deployment was authorized by a presidential decree that left open the possibility that soldiers could be used more widely in Brasilia.
Late Wednesday, Temer's office issued a statement defending the order as necessary because the violence put the lives and safety of public servants at risk. It said the president had determined that using the country's National Force, an elite police entity, would not have been sufficient.
"When order is re-established, the decree will be revoked," the statement said. "The president of the republic underscores that he will not hesitate to exercise the authority given to his office whenever it is necessary."
Temer is struggling to retain power after the release of a recording that appears to capture him approving hush money for a convicted former lawmaker. Brazil's top court is investigating him for alleged obstruction of justice and involvement in passive corruption. The president has denied wrongdoing and insists he will not resign.
His unusual decision to call in the military could heighten anger against the government if it is seen as the last gasp of a president trying to maintain power with the use of force.
"This decree was never used in this context to protect an administration that is politically isolated," said Newton de Oliveira, a professor and security specialist at Mackenzie University in Rio.
After the announcement that troops were taking up positions in the capital, some senior officials began distancing themselves from the decision.
"If this government cannot hold itself up, the armed forces will not hold up this government," said Sen. Renan Calheiros, who is the whip for Temer's party in the upper house but has increasingly challenged the president.
Sen. Romero Juca, a Temer ally, defended the president's decision. "President Temer brought in the armed forces because a bunch of criminals were setting ministries on fire," he said.
With Brazil deeply divided and a political crisis deepening, sessions in both houses of Congress became chaotic as lawmakers shouted one another down.
While Congress debated, 35,000 people were marching toward the legislative building, shouting "Out with Temer!" and carrying signs calling for an immediate direct presidential election.
If Temer should resign, Brazil's constitution says Congress would elect the next president, who would hold power for the rest of his term, which runs to the end of 2018. But many Brazilians, disgusted with the political class, want to vote themselves.