Protesters demanding Temer's exit smashed their way into ministries and fought with riot police on Wednesday.
A decree published online in the official journal said the president had revoked an earlier measure to deploy the forces.
Protesters demanding Temer's exit smashed their way into ministries and fought with riot police on Wednesday in some of the most violent scenes yet in a year of political turbulence.
The deployment of soldiers sent a psychological shockwave through a capital already shaken by the day's violence and an investigation into corruption allegations against the president.
The issue of troops is deeply sensitive in a country that lived under military rule from 1964-1985.
Conservative Temer replaced leftist president Dilma Rousseff last year after she was impeached on what she said were trumped-up political charges.
Now he faces impeachment calls from his own political rivals.