Bernardino Machado Bernardino Luís Machado Guimarães , ( ; 28 March 1851 , in Rio de Janeiro , Brazil – 29 April 1944 , in Porto , Portugal ) , was a Portuguese political figure , the third and eighth President of Portugal ( 1915 – 17 , 1925 – 26 ) . Early life . He was the son of António Luís Machado Guimarães ( 1820 - 1882 ) , 1st Baron of Joane and a Nobleman of the Royal Household , a rich merchant raised to the Nobility , and his second wife Praxedes de Sousa Guimarães . He came to Portugal in 1860 , enrolled at Coimbra University in 1866 , studied Mathematics for three years , and graduated in Philosophy in 1873 . In 1872 , he chose to obtain Portuguese nationality . Continuing with his studies , he obtained a doctorate in Philosophy in 1876 , and graduation in General Agriculture and Rural Economy in 1883 . He lectured at that institution since 1877 . In Porto in January 1882 he married Elisa Dantas Gonçalves Pereira ( Rio de Janeiro , Rio de Janeiro , 15 December 1865 – 21 April 1942 ) , by whom he had sixteen children . One of his sons in law was the writer Aquilino Ribeiro . Political scene . He then turned to a second interest ; in 1882 was elected to the Portuguese parliament for Lamego , and in 1886 for Coimbra . In 1890 and 1894 was also elected Peer of the Realm by the Coimbra University . During this period he was briefly Minister for Public Works on the Hintze Ribeiro cabinet , in 1893 and created the first labour court in Portugal . Taking a special interest in public education during his political activity he was made part of the Superior Council of Public Education in 1892 , and published several books on the subject . Machado was also briefly President of the Directory of the Democratic Party in 1902 , and after switching to the Republican Party , was this party ' s President of the Directory from 1906 to 1909 . He was one of the few monarchists - turned - republican who switched still during the monarchy . Once the Republic was proclaimed in 1910 he was made Minister for Foreign Affairs , and ran an unsuccessful campaign for the Presidential elections of 1911 . Afterwards appointed ambassador to Brazil , made his political comeback in 1914 to lead one of many brief cabinets the country had in this period . Machado ran again to the Presidency in 1915 and was this time elected President of Portugal . In the course of his term , he received Germany ' s declaration of war ( March , 1916 ) , and visited the Portuguese forces placed in France in the battlefields . In 1917 the government was deposed by a military coup headed by Sidónio Pais , and Machado went into exile . Upon Machado ' s return in 1919 he was elected Senator . He served as Prime Minister from 10 February to 23 May 1921 . Once again , in 1925 , he achieved the presidential office after President Teixeira Gomes resigned , only to be overthrown a year later ( 1926 ) by Gomes da Costa ( See : 28 May 1926 coup d ' état and Ditadura Nacional ) . The country remained under a military , then civilian , dictatorship until 1974 . For a second time he went into exile in France , where he continued to be very critical of the Portuguese regime . The German occupation of France in 1940 forced him to seek protection in Portugal , which the government granted him with the condition that he was to be confined to his personal retreat in the northern part of Portugal . It was there in Oporto that he died in 1944 . Personal life . He was father - in - law of the famous writer Aquilino Ribeiro . He was great - grandfather of the psychologist and sexologist Júlio Machado Vaz . Books . city