General Eduardo Vilas Boas's comments came as leftist President Dilma Rousseff described efforts to impeach her as tantamount to a coup.
"Our actions will be fully supported by what is established in the law, from the constitution to additional legislation, always acting under orders from one of the powers of the republic," he said.
He cited part of the constitution that says the armed forces must act under the president's authority.
"We are going to contribute to maintaining stability" while state institutions seek a solution, he said.
Also Read
Brazil was ruled by a military dictatorship from 1964 to 1985. Rousseff herself was jailed for part of that time for belonging to an armed dissident group.
Lawmakers have launched a congressional committee charged with deciding whether to bring a motion to impeach Rousseff over corruption allegations.
The 68-year old president's popularity has plunged as she also grapples with a deep recession in Latin America's biggest economy.
In an interview with foreign newspapers, Rousseff said any attempt to remove her without legal basis would represent a "coup."