Messi faced stiff competition from Liverpool’s Virgil van Dijk and long-time rival Cristiano Ronaldo, who finished in second and third places respectively.
The award was Messi’s first since 2015 and it took him one clear of Ronaldo, who has won it five times.
Modric won the Ballon d’or last year after helping Real Madrid to a third straight Champions League title and leading Croatia to the FIFA World Cup final, where they lost out to France.
The Croat presented Messi with his award on Monday and thereafter took to social media to congratulate his rival.
"Sports and football are not just about winning, they're also about respect for your team-mates and rivals," Modric wrote on his social media accounts alongside a picture of him handing Messi the award.
Lewandowski, who has been in superb goalscoring form for Bayern Munich this season, finished eighth on the final Ballon d’or standings.
The Polish striker was full of praise for Messi, heralding him as ‘one of the best ever’.
"For sure he is a great player. I can only say congratulations to him," he told reporters.
"It's not the first time for him, one of the best in history not just the last few years.
"I'm glad to be close to so many players because we only get to meet each other on the pitch and now this is something different.
"For sure he is a great player, not just the past year but for 10, 15 years."