Pérez Velasco, was defeated after a hard-fought election. President of Bolivia First term On October 20, 1904, the Treaty of Peace and Friendship with Chile was signed, which put an end to the state of war between the two countries, not ended since the War of the Pacific because only a truce had been signed in 1884. In the treaty, Montes recognized the absolute and perpetual cession of the Bolivian coast occupied by Chile. According to Bolivian historiography of the mid-20th century onwards, this treaty was the result of the harassing pressure exerted by Chile on Bolivia (motivated by the expropriation of Chilean and foreign capital that triggered the War of the Pacific), with customs controls and trade restrictions. The liberal governments of Pando and Montes believed that it was time to turn the page with Chile and were convinced that the development of the railways and free transit, stipulated in the treaty, were compensations that were worth the sacrifice. In 1902, Chile had signed a treaty with Argentina that ended their militaristic rivalry with Buenos Aires, reducing its military personnel, creating a compulsory military service law and reducing the number of naval units, meaning that Chile could hardly aspire to exert military pressure on the Montes government. Montes also signed a trade and customs treaty with Peru in 1905. A staunch liberal, Montes established civil marriage, freedom of worship and the abolition of ecclesiastical jurisdiction, which caused a rupture between the Holy See with the Bolivian government, as fundamental liberties and rights in the Bolivian Constitution. He also modernized the Bolivian Army, managing to bring a French military mission from Europe. During the general elections of 1908, the government promoted the candidacy of the politician Fernando Eloy Guachalla for President and Eufronio Viscarra for Vice President, a formula that was successful. However, Guachalla fell ill and died shortly before assuming the presidency. Under the influence of Montes, the liberal majority in Congress denied Vice President Viscarra the right of succession, with Atanasio de Urioste Velasco alleging that the incumbent's death had occurred before he took office, which allowed Montes to be granted a year-long extension to his current term. During the general elections of 1909, the liberal candidate Eliodoro Villazón Montaño, from the Liberal Party, was victorious. Second term In 1913, Montes returned to Bolivia from Europe to run again for the presidency of the republic. He won the