The first victory of liberalism in the country was during the country's first civil war, the Ochomogo War in 1823 when the liberal-dominated cities of San José and Alajuela fought against the conservative-dominated cities of Heredia and Cartago due to the former's wish to split from the First Mexican Empire and becoming a Republic, whilst the Heredian and Cartaginese creole aristocracy favored to remain in the Empire as a way to protect their interests, and also as a clash of economic visions between the more liberal bourgeoisie and the agrarian aristocracy.[1] The war between the Republicans and Imperialists was won by the Republicans and the capital was moved from Cartago to San José.
Liberals will rule the country since its independence from Mexico, as almost all Presidents were liberals between 1825 and 1940 with only a few exceptions, and even during the country's membership in the Federal Republic of Central America.[2] The dissolution of the federal entity and the full separation of the then call State of Costa Rica in 1838 saw the country under the authoritarian regime of Braulio Carrillo, who was deposed by Honduran liberal Francisco Morazán who tried to restore the Federation, but was also deposed by a coup. The constitutional reform of José María Castro Madriz in 1847 turned the country officially into a Republic.[3][4][5]
This period of dominance of the liberal ideas is known as the Liberal State of Costa Rica and encompassed between 1870 and 1940. Liberals of these times were mostly Freemasons. Freemasonry in Costa Rica was introduced in the country by Catholic priest and military chaplain Francisco Calvo in 1856 and almost all liberals were masons, to the point that the Catholic archbishop Víctor Sanabria denounced Masonry and liberalism as equal partners.
Due to the hegemony of the liberals, all de facto governments and internal factional conflicts were between them.[1][2] As for example the authoritarian governments of Carrillo, Guardia and Tinoco who led coups against other liberals Manuel Aguilar Chacón, Castro Madriz and Alfredo González Flores respectively.[1] One of the few non-liberal presidents was Vicente Herrera Zeledón in the 1876-1877 period who was conservative, but was hand-picked by Guardia and was considered his puppet. Another breaking of the liberal line happened in the 1889 Costa Rican general election when José Rodríguez Zeledón, endorsed by the Catholic Church, managed to defeat liberal Ascensión Esquivel Ibarra. Even as the government was tempted to reject the results and appoint Esquivel anyway, popular unrest made it respect the popular vote. But this victory was short-lived, as Rodríguez would break from the Church, using questionable methods to ensure the victory of his son-in-law Rafael Yglesias over the candidate of the Catholic Union in the following election.[1]
The Unity Coalition was the alliance of four parties: Christian Democratic Party, Republican Calderonista Party (led by Calderon's son), the People's Union (led by Trejos) and the more left-wing Democratic Renovation (led by Carazo).[1] It merged in the Social Christian Unity Party in 1983 establishing Costa Rica's two-party system. Liberals became a faction inside PUSC but were a minority after the Calderonistas and Christian Democrats.[9] Despite their clear influences in the Echandi and Trejos government (not so much in Carazo's who was more left-leaning) and the election of Miguel Ángel Rodríguez Echeverría (a confirm liberal) as PUSC candidate and then Costa Rican President in the 1998 Costa Rican general election, Costa Rica lacked an official liberal party for decades.[1]
This changed with the foundation of the Libertarian Movement in 1994. As the name implies the party was originally libertarian with some very radical ideas for the time, including demolishing completely the Welfare State, eliminating all public monopolies, legalizing same-sex marriage and recreational drugs,[10] among other controversial positions in the Costa Rican society that was (and continues to be) very left-wing politically but very conservative socially. The party's first election was in 1998 and won one seat in the person of Otto Guevara Guth, lawyer and entrepreneur, Guevara became the party's lead figure and perennial candidate having run for president five times. The party modified its more radical position to become more mainstream,[11] leaving most radical ideas behind and becoming libertarian only in name, entering the Liberal International and turning more into a liberal conservative party.[12]