Born in Recife, Pernambuco, Hermenegildo was the son of Luís da Costa Ferreira and Ana Teodora Pita Portocarrero de Melo e Albuquerque.[1] He began his military career, at the age of 18, on 28 January 1836.
He was commander of the New Coimbra Fort at the beginning of the Paraguayan War. However the fort was surrounded by a force of 5,000 Paraguayan infantry, transported in ten ships by Colonel Vicente Barrios from Asunción. Portocarrero was given an ultimatum to surrender but he refused, stating that he would fight to the last cartridge, despite the inferiority of men and weapons. The garrison of the fort of only 115 men, while in the entirety of the Province of Mato Grosso, there were less than 875.[2]
After two days and a night of incessant bombardment, and unable to face the enemy forces, the small garrison, protected by darkness, abandoned the fort and boarded the speedboat Anhambaí, which went to Cuiabá.[3]
Hermenegildo himself broke the news of the invasion of the fort on 6 January 1865, to the president of the province Alexandre Manuel Albino de Carvalho [pt].
Portocarrero was promoted to lieutenant colonel and together with all available soldiers and the determination of the governor of the province, went to Colina do Melgaço, located on the left bank of the Cuiabá River, 165 kilometers from the capital, to avoid the arrival of Paraguayan ships to Cuiabá, which was successfully done.
Portocarrero was made a baron on 13 July 1889.[4]
He died as a marshal in Rio de Janeiro on 12 September 1895, at the age of 75.[1][5] He was the commander of the defunct Coast Artillery of the Brazilian Army. He was married to Ludovina Portocarrero (1825–1912), with whom he had fifteen children. Among his descendants, the actress Tônia Carrero was the most notable of them.