The 28-year-old Argentine former US Open champion beat Jack Sock in straight sets in the Swedish capital to win his first ATP title in almost three years.
It was his first appearance in a Tour final since he beat Bernard Tomic in Sydney in 2014, and his win comes two months after he reached the Olympic final in Rio de Janeiro, where he was beaten by Andy Murray.
Novak Djokovic remains the world number one ahead of Murray, with Stan Wawrinka in third spot, while Roger Federer is up a place to seventh.
Murray can take over the number one spot if he wins the three remaining tournaments of 2016, starting with Vienna this week.
Latest ranking top 10
1. Novak Djokovic (SRB) 12,900 points; 2. Andy Murray (GBR) 10,485; 3. Stan Wawrinka 5,820, 4. Milos Raonic (CAN) 4,690, 5. Kei Nishikori (JPN) 4,650; 6. Rafael Nadal (ESP) 4,380; 7. Roger Federer (SUI) 3,720 (+1); 8. Gaël Monfils (FRA) 3,635 (-1); 9. Dominic Thiem (AUT) 3,250 (+1); 10. Tomas Berdych (CZE) 3,060 (-1)
Others
42. Juan Martin del Potro (ARG) 1,020 (+21)