He designed military fortifications for the city of Florence
The citizens of Michelangelo's hometown of Florence overthrew the governing Medici family and elected a republican government in 1527. Despite working for the Medici Pope Clement VII, Michelangelo supported the republican cause and was named director of the city's fortifications. He took the job seriously, sketching out elaborate lookout bastions and even visiting adjacent cities to study their defense walls.
When the Pope's army arrived to recover the city, his designs proved a serious impediment, and Florence survived a 10-month siege before finally succumbing in August 1530. Michelangelo could have been hanged as a traitor, but Clement VII forgave him and instantly rehired him for his role in the uprising. However, the artist's status in Medici-ruled Florence remained precarious, and when the Pope died in 1534, Michelangelo fled to Rome, never to return.