Born in 1749 in Montilla, Córdoba, Diego de Alvear joined the Royal Navy at the age of 20, serving under important seamen such as Jorge Juan, Mazarredo, Apodaca and Langara.
In 1777, a treaty between Spain and Portugal to define territorial borders in America was signed and, as a result of this, Alvear was appointed First Commissioner of the second session for the demarcation of borders. This work was carried out over 18 years in the area of the Paraná and Paraguay rivers. During that period, Alvear devoted himself to making topographical plans and studying botany, wildlife and the Tupí and Guaraní Indians.
In 1804, after finishing his work in America, Diego de Alvear set sail from Montevideo for Spain in a fleet of four frigates, with General Bustamante at the helm. Ugarte, commander of the frigate Medea, fell ill in Montevideo and so Diego de Alvear and his eldest son, Carlos, transferred to this ship, leaving his wife and seven of their children aboard the frigate Mercedes.
On 5 October 1804, the Spanish fleet was the victim of an attack by a British fleet near Cape Santa María, off the Portuguese coast of the Algarve. After fierce bombardment by the British, the powder magazine of the frigate Nuestra Señora de las Mercedes exploded, causing the ship to sink immediately; it took with it the lives of Diego de Alvear's wife and children. Diego de Alvear himself and his son Carlos were captured and taken to England as prisoners. During his captivity in London he met the Englishwoman Luisa Ward, who he married and with whom he had another ten children.
After his return to Spain and in the face of the Napoleonic invasion, Alvear was put in charge of the artillery units that defended Cadiz and where he managed to cut the French off. He was appointed political and military governor of the island of León (today San Fernando) and his success in the defence of Cadiz earned him the Great Cross of San Hermenegildo.
The restoration of absolutism in 1823 led to Diego de Alvear being discharged from the Navy because of his liberal ideas and his honours were withdrawn, until, years later, he travelled to Madrid to have them recognised, dying there on 15 January 1830.