Media playback is not supported on this device
The Portugal captain, 28, was named world player of the year for the first time since 2008 by national coaches, captains and journalists.
It is a tremendously emotional moment
Germany goalkeeper Nadine Angerer was named best women's player, while former Bayern Munich boss Jupp Heynckes picked up the coach of the year accolade and Germany manager Silvia Neid claimed the women's award.
Ronaldo claimed the award with a total of 1,365 points, ahead of Messi (1,205) and Ribery (1,127), with the votes cast by 184 coaches, 184 national captains and 173 members of the global media.
Neither Ronaldo or Messi voted for the other in their top three.
Cristiano Ronaldo didn't vote for Lionel Messi, and Messi didn't vote for Ronaldo.
Find out who voted for whom in a breakdown of the results
Ronaldo selected Radamel Falcao for first place, followed by Gareth Bale and Mesut Ozil, while Messi opted for Barcelona team-mates Andres Iniesta, Xavi and Neymar.
England manager Roy Hodgson chose Ronaldo, Zlatan Ibrahimovic and Robin van Persie as his top three, while captain Steven Gerrard picked Ronaldo, Messi and Liverpool team-mate Luis Suarez.
Messi, 26, had won the award for the last four years, but Ronaldo had been viewed as the front-runner this time after scoring 66 goals in 56 games in 2013 for club and country.
They included a sensational hat-trick for Portugal against Sweden in their World Cup qualifying play-off second leg, which sealed a place in the finals in Brazil.
"First of all, I have to say a great thanks to all of my team-mates with the club and the national team," Ronaldo said as he cried during his speech.
"Without all of their efforts, this would not have been possible. I am very happy; it is very difficult to win this award.
"Everybody that has been involved with me on a personal level, I have to thank - my wife, my friends, my son. It is a tremendously emotional moment. All I can say is thank you to everybody that has been involved."
Angerer, 35, saved two penalties in Germany's 1-0 win over Norway in the 2013 European Championship final and was named player of the match.
"I have to say that I'm a little surprised, but very thankful," the Brisbane Roar goalkeeper said. "You never get a success like this on your own. I have to thank my team-mates and my goalkeeping coach who raised me to a level that I never thought I'd get to."
Media playback is not supported on this device
Heynckes, who retired at the end of the last season after guiding Bayern Munich to a historic treble, said he was "humbled and happy" to have won his award.
The Ballon d'Or Prix d'Honneur was awarded to Brazil legend and three-time World Cup winner Pele. "I promised to my family that I would not cry but I am emotional," he said.
"I got so many trophies and prizes but I was jealous of all of those guys who got the Ballon d'Or, which I couldn't get because I didn't play in Europe. Now I thank God that I can complete my trophies at home."
The Puskas Award for goal of the year went to Ibrahimovic for his 30-yard overhead strike for Sweden - his fourth goal of the game - against England in November 2012.
Former president of the International Olympic Committee Jacques Rogge won the Fifa presidential award, while the Afghanistan Football Federation won the fair play accolade for the strides they have made advancing the game in the war-torn country.
Manuel Neuer (Bayern Munich)
Dani Alves (Barcelona)
Thiago Silva (PSG)
Sergio Ramos (Real Madrid)
Philipp Lahm (Bayern Munich)
Andres Iniesta (Barcelona)
Franck Ribery (Bayern Munich)
Xavi (Barcelona)
Cristiano Ronaldo (Real Madrid)
Zlatan Ibrahimovic (PSG)
Lionel Messi (Barcelona)
Real Madrid forward Cristiano Ronaldo beat Barcelona's Lionel Messi and Franck Ribery of Bayern Munich to win the 2013 Fifa Ballon d'Or.