Sweden is the best country for older people; Afghanistan the worst – but general affluence does not necessarily mean better conditions for the over-60s, according to the first global index on ageing.

While Sweden's top ranking – followed by Norway, Germany, the Netherlands and Canada – may be predictable, the Global AgeWatch index throws up some surprising results.

The US, the world's richest country, languishes in eighth place, while the UK fails to make the top 10, residing instead at No 13. Sri Lanka ranks 36, well above Pakistan at 89, despite similar levels of gross domestic product (GDP). Bolivia and Mauritius score higher than the size of their economies may suggest, while the emerging economies of Brazil, Russia, India and China are a mixed bag. Brazil and China rank relatively high on the index; India and Russia sit much lower.

"This survey shows that history counts," said Mark Gorman, director of the HelpAge International advocacy group. "The top-ranked countries are what you would expect, but Scandinavian countries were not wealthy when they [introduced] universal pensions.

"The older population in Sri Lanka today is benefiting from good basic education and healthcare – those countries made certain policy choices. Everybody faces scarce resources, but they should not forget that when they make investment decisions, they should also address issues of old age."

The index, developed with the UN fund for population and development, spans 91 countries and 89% of the world's older people. The survey comes amid a major demographic shift: by 2050, there is expected to be 2 billion people aged 60 and over, who will comprise more than a fifth of the world's population.

Population ageing – when older people account for an increasingly large proportion of people – is happening fastest in developing countries. More than two-thirds of older people live in poor countries; by 2050, this proportion is expected to be about four-fifths.

While it took 115 years for the older population of France to double from 7% to 14% between 1865 and 1980, Brazil is likely to make the same shift between 2011 and 2032 – in just 21 years.

The index shows that the fastest ageing countries – Jordan, Laos, Mongolia, Nicaragua and Vietnam, where the number of older people is predicted to more than triple by 2050 – fall into the lower half of the ranking, suggesting that policymakers need to tackle ageing head-on if they are to adequately support their populations.

There are gender differences among ageing populations, with women generally outliving men. In 2012, for every 84 men aged 60 and over, there were 100 women. Lack of paid work (hence savings), less decision-making power in the family and vulnerability to violence contribute towards the disadvantage many women face in old age.

However, if appropriate measures are implemented, population ageing does not inevitably lead to significantly higher healthcare spending, according to the report, which highlights the importance of long-term investments in education and healthcare for older people.

Bolivia, ranked 46, despite being one of the poorest countries, has introduced progressive policies for older people, with a national plan on ageing, free healthcare and a non-contributory universal pension. Nepal, ranked 77, introduced a basic pension in 1995 for people over the age of 70 without other pension income. Though limited in value and eligibility and with uneven coverage, it is an example of how a poor country has chosen to make a start in addressing poverty in old age.

Good basic healthcare introduced decades ago in Chile and Costa Rica has served the ageing populations of those countries. A good education system – basic literacy is crucial for older people as they deal with the pensions bureaucracy – is of great benefit later in life.

In the Philippines, older people have benefited from the educational reforms introduced after independence in 1946, which made elementary and high school education compulsory. The same is true for Armenia, which, like other countries of the former Soviet Union, benefited from a robust education system.

South Korea, a surprisingly low 67 on the ageing index, performed worse than its peers on a GDP-per-head basis, partly because it introduced a pension only recently.

The ageing index is calculated using 13 indicators under four headings: income security, healthcare, employment and education, and an enabling environment. All indicators have equal weight, except for pension income coverage, life expectancy at 60, healthy life expectancy at 60, and psychological wellbeing. These categories were given increased weighting because of better data quality, and countries were included only if there was sufficient data.

Professor Sir Richard Jolly, creator of the human development index, said: "This ground-breaking index broadens the way we understand the needs and opportunities of older people through its pioneering application of human development methodology. It challenges countries in every part of the world to raise their sights as to what is possible."