Her father, Miguel Dantas Gonçalves Pereira, from Formariz, Paredes de Coura, established himself in Rio de Janeiro, Empire of Brazil, as a partner in a commercial firm, in 1860. There, he married a Brazilian lady, Bernardina da Silva, and Elzira Dantas was their only daughter. Bernardina died soon after, and Miguel Dantas Gonçalves Pereira and his daughter returned to Portugal.[2] Her father remarried in April 1876, with his cousin Maria de Assunção Gonçalves Pereira.
Raised in an affluent family, Elzira received a thorough education by foreign preceptresses. Her education, influenced by the Regeneration values of economic progress and social usefulness, no doubt prepared her to assume the role of wife and mother. She, however, was involved in the movement for women's emancipation from a young age.[2]
At age 17, on 19 January 1882, she married Bernardino Machado, then a young professor at the University of Coimbra. In the years that followed, the couple would have a total of nineteen children.[3][4] Her husband was then starting a political career with the Regenerator Party but, after serving as a member of Parliament and briefly as a government minister, grew disillusioned with the monarchical establishment and joined the Portuguese Republican Party. Through her husband, Elzira Dantas Machado corresponded with several prominent republican and feminist intellectuals, such as Alice Pestana, Ana de Castro Osório, Maria Veleda, Carmen de Burgos.
Following the overthrow of the monarchy in 1910, her husband occupied several important offices; government minister, ambassador and, briefly, in 1914, Prime Minister. In 1915, her husband was elected President of the Republic. With the start of the First World War and Portugal's participation in the conflict, Elzira Dantas Machado helped create the Portuguese Women's Crusade in 1916, with the purpose of aiding soldiers and their families. In December 1917, a revolutionary junta led by Sidónio Pais staged a coup d'état that overthrew the government led by Prime Minister Costa and President Machado. Elzira Dantas accompanied her husband into exhile in France.[5]
Her husband was elected President a second time, in 1925. By then, the political decline of the First Portuguese Republic was accentuating and, in May 1926, a military coup initiated a dictatorial regime. Elzira Dantas Machado again accompanied her husband into exhile, in France and Spain. During the Second World War and the Fall of France, in 1940, Salazar's government allows the Machados to return to Portugal.[5]