Ramirez had managed the Costa Rican team since 2015, helping them to qualify for the World Cup in Russia.
"Oscar's contract expired after the game against Switzerland. The decision not to extend it has been coordinated with the Executive Committee. I want to thank the coach for all the efforts," FEDEFUTBOL President Rodolfo Villalobos said as quoted by the federation on its website.
Costa Rica finished bottom of Group E with one point, losing 1-0 to Serbia and 2-0 to Brazil and ending their final group-stage game in a 2-2 draw with Switzerland.
The 2018 FIFA World Cup kicked off on June 14 and will continue until July 15, with the matches being played in 11 cities across Russia.