Japan has had the longest life expectancy in the world for years.

But a study in the journal Lancet says Spain will earn the first-place spot by 2040 with a life expectancy of 85.8 years.

Spain ranks highly in lists of healthy countries; most recently, it tied for first in the World Economic Forum’s “Global Competitiveness Report.”

The US will fall significantly in the rankings, reaching 64th place by 2040.

Japan will soon lose its long-standing title as the country with the longest life expectancy.

According to a study published Tuesday in the journal Lancet, Spain is on track to overtake Japan by 2040.

Its 85.8-year life expectancy will just surpass the 85.7-year life expectancy in Japan and the 85.4-year average in Singapore.

The remainder of the top 10 will feature Switzerland, Portugal, Italy, Israel, France, Luxembourg, and Australia, according to the study.

Expatica, an online guide for expats, estimates that Spain spends about 10% of its GDP on healthcare. It also ranks highly in lists of healthcare systems around the world. The World Economic Forum’s “Global Competitiveness Report,” for example, recently listed Spain as one of the healthiest countries.

Globally, the average rise in life expectancy between 2016 and 2040 is estimated to be 4.4 years, though the US will be far below.

Lees ook op Business Insider Huis kopen? Aanpassing overdrachtsbelasting in 2021 zorgt ervoor dat starters beter even wachten – beleggers moeten juist nu hun slag slaan

Americans’ average life expectancy will go up only 1.1 years to 79.8, and the US will drop from 43rd to 64th place in world rankings.

China, which had a life expectancy of 76.3 years in 2016, is predicted to hit an average of 81.9 years by 2040. The increase would put China in 39th place.

Four countries in sub-Saharan Africa will have life expectancies of less than 65 years by 2040, the study found. Of the 195 countries and territories analyzed, Lesotho will have the lowest life expectancy, with an average of 57.3 years.

In a worst-case result, Lesotho’s life expectancy could be as low as 45.3 years, according to the study. The bottom spot is currently occupied by the Central African Republic, whose life expectancy the CIA puts at 52.8 years.

Read more: The 15 unhealthiest countries in the world

The study’s authors, who work at the University of Washington’s Institute for Health Metrics and Evaluation, relied on existing data about diseases to make their predictions. For example, they incorporated information about rates of cancer, diabetes, and HIV/AIDS.

Alcohol use, tobacco use, high blood pressure, high body-mass index, and high blood sugar cause the highest number of premature deaths, the study said, and these moralities are expected to increase. Though other risks, such as unsafe water and child malnutrition, are expected to decrease, the overall life expectancy will go up more slowly than before.