Alvarado is on the track to win the presidential election, overcoming a challenge by a socially conservative religious singer who ran on his opposition to same-sex marriage, The Washington Post reported.
With about 90 percent of the votes counted, Alvarado, who had served in cabinet positions for the current president, Luis Guillermo Solis, had captured 60.6 percent, according to the country's Supreme Electoral Tribunal.
His opponent, Fabricio Alvarado Munoz, had been riding momentum based on his opposition to same-sex marriage and abortion and his stance on other social issues.
He, however, received only 39.3 percent of the votes, at the time of filing this report.
This year, the Inter-American Court of Human Rights ruled that member countries should allow same-sex marriage.
"The inter-American court's ruling was really the equivalent of dropping an atomic bomb on the race. The whole race was transformed literally overnight. The election became, de facto, a referendum on same-sex marriage," The Washington Post quoted Kevin Casas-Zamora, a senior fellow at the Inter-American Dialogue in Washington and former vice president of Costa Rica, as saying.
Central American countries tend to be predominantly Catholic and socially conservative, with relatively strict laws limiting abortion.
In Costa Rica, the evangelical vote has been growing in recent decades, and polls have shown that a majority of Costa Ricans oppose same-sex marriage.