The gap in economic opportunity between American men and women is narrowing, but the U.S. still can’t seem to get ahead in the global race for equality.

The United States came in at No. 20 out of 142 countries in this year’s ranking of gender equality by the World Economic Forum. It marks a comeback of sorts for the country after having slipped out of the top 20 for the past two years.

The Global Gender Gap Index, released Monday night, measures gender-based disparities in individual countries over time. The organization ranks countries based on the progress they’ve made to close the gender gap in four categories: economic participation and opportunity, educational attainment, health and survival and political empowerment.

The highest possible score on the index is 1 and means that a country has fully eradicated the gender gap in every measured category. No country has actually done so since the index was first published in 2006.

Iceland, which has had a female head of state in 20 of the past 50 years, ranked No. 1 on WEF’s index with a score of .859. The country was closely followed by its Nordic neighbors: Finland, Norway, Sweden and Denmark. The U.S. finished with a score of .746, putting it behind countries like Canada, South Africa and France, but ahead of other developed countries like the United Kingdom and Australia.

A surprising finding is that the U.S. ranks lower than some countries with considerably less economic development. Rwanda and Nicaragua both have less than $9 billion in GDP, but both rank among the top 10 countries in the world when it comes to gender equality. The index measures gender disparities in access to resources and opportunities, regardless of overall resource availability and level of economic development.

“Both rich countries and poor countries can afford gender equality,” World Economic Forum Senior Director Saadia Zahidi said in an interview with Fortune. “Gender equality doesn’t have to only come along once a country is fully developed.”

Among the four equality categories WEF uses to rank countries, the U.S. ranked lowest in health and survival. While women outlive men by an average of about six years in OECD countries, American women outlive their male counterparts by just about three years, which hurt its ranking, said Zahidi.

The U.S. was also penalized by the shortage of women in political power, ending up ranked No. 54 in the political category largely because it has never had a female president. At a cabinet level, the U.S. has seen a slight increase with women holding 32% of positions compared with 27% last year. In Sweden, a relative utopia for female political leaders, women make up 57% of all ministers.

America is making the most progress closing the gender gap in terms of economic participation and opportunity. Ranked No. 4 on WEF’s list behind Burundi, Norway and Malawi, the U.S. has closed nearly 83% of the gender gap in the workplace since WEF first conducted the study in 2006. For the first time, the U.S. exceeded gender parity for professional and technical workers, 55% of whom are now women. Yet it still has work to do on wage equality for similar work: In the sub-category of wage equality, the U.S. received the low score of .66.

At this rate, the global gender gap in the workplace is not expected to close until 2095. Efforts to narrow the gap are moving at a glacial pace because a lot of the benefits are just coming to light now, Zahidi said. More companies globally are acknowledging that businesses that include more women at the top tend to outperform those who don’t. Also, more women are graduating from college than men while buying power among women is growing as well. As public figures like Melinda Gates and Hillary Clinton take on investing in women and girls and closing the gender gap as public platform, Zahidi added the rate of change should increase.

“The notion that gender equality is not only the right thing to do, but the smart thing is a fairly new mindset that did not exist in the public consciousness even five years ago,” she said. “In the short-term, this kind of change is hard because it is millions and millions of individual changes that need to come together on a global level.”

To subscribe to Caroline Fairchild’s daily newsletter on the world’s most powerful women, go to