José María was born in Montevideo, son of Cayetano Torres, born in Spain, and Manuela Mascareñas y Bustamante, belonging to a patrician family from Buenos Aires. He began his military career at the age of 13 participating in the defense of the City against the British, being prisoner on February 3, 1807 during the Battle of Montevideo. During the events of May 1810, Torres who at that time served as lieutenant, had adhered to the patriot cause, moving to render his services in Buenos Aires.