The music of the National Anthem of Costa Rica dates back to June 1852. Its music was composed by Manuel María Gutiérrez Flores, director of the military band of San José, who dedicated the score to the French Gabriel-Pierre Lafond. The music was created for the reception of the diplomatic representatives of United Kingdom and United States in that year. It is said that the composer Manuel María Gutiérrez, had to compose the music for the anthem locked in jail after refusing the order of the president Juan Rafael Mora Porras to compose the anthem in 24 hours. The music had to wait 127 years for its formalization, and it was not until September 1979, with President Rodrigo Carazo, promulgated the decree in question.
The National Anthem has had several letters, the current was written for a competition called in 1903 to give the song lyrics that reflect the idea of being a Costa Rican, under the government of Mr. Ascensión Esquivel Ibarra. The competition was won by José María Zeledón Brenes, and was declared officially in 1949 under the government of José Figueres Ferrer.