Fortune has for the second consecutive year declared Apple the most profitable company in the world, despite coming in 9th overall in the Fortune Global 500. The rankings are based on the most recent financial year for each company.

Fortune is best known for its Fortune 500 ranking of U.S. companies, where Apple this year took the #3 slot. But the company also compiles a global list, and it’s here that Apple came in 9th in the overall rankings but #1 in profitability …

The overall rankings are based on revenue, with Walmart taking the top slot.

The world’s 500 largest companies generated $27.7 trillion in revenues and $1.5 trillion in profits in 2016. Together, this year’s Fortune Global 500 companies employ 67 million people worldwide and are represented by 34 countries.

Walmart’s revenue was a little over $485B, while Apple earned its 9th place with $215B.

But when it comes to profits, it’s a very different story. There, Walmart is relegated to 17th place, with profits of $13.6B, while Apple took first place with $45.7B.

After more than a decade of solid growth fueled first by the iPod music player and then by the even more popular iPhone, Apple finally appeared to hit a wall, with lackluster sales “relatively speaking” for other products such as the iPad and Apple Watch and a heavy reliance on upgraded phone models. But the most profitable publicly-traded company in the world is investing heavily in software and its efforts in new areas of opportunity, including automobiles, remain in development (and under wraps).

Apple retained its position despite its profits falling 14.4% year-on-year. It also topped Fortune’s list of the world’s most admired companies.

Apple is the largest company in the world by market cap, and has long been predicted to be the first company to be worth a trillion dollars (though not everyone agrees).

Check out 9to5Mac on YouTube for more Apple news:

FTC: We use income earning auto affiliate links. More.

Check out 9to5Mac on YouTube for more Apple news: