Martin scoops maiden MotoGP world championship title as Bagnaia wins finale
Defending two-time champion Francesco Bagnaia, who started the race 19 points behind Martin, took the chequered flag for the 11th time this season but it was not enough to wrest the title from the Spaniard.
"It sounds amazing," said an emotional Martin after being addressed as a world champion for the first time.
"I don't know what to say, I am completely shocked.
"This is for my people, for my family, for the people who are supporting me, this is for them.
"I started crying at the end, it was a very emotional race. It's been a long journey, a lot of crashes, big injuries but finally we are here.
"I hope we can keep improving and enjoy the moment. This is the most important thing: live the present and enjoy the moment."
Martin, who will be leaving his Ducati satellite team Pramac for Aprilia next season, had made himself the favourite for the title with a remarkably consistent season.
He had only won three grand prix all season, but his third-place on Sunday was the 32nd time this season across the 40 sprints and grand prix that he made the podium.
After finishing third in Saturday's sprint he knew he had only to finish in the top nine to secure the title.
Bagnaia, however, has finished the season in blistering form, his victory in Barcelona giving him his fourth win over the final five races of the season.
Starting from pole, the Italian made a perfect start but was soon under pressure from Marc Marquez who slipped past Martin.
Martin let them battle it out up front, guarding his track position as Aleix Espargaro and Alex Marquez toughed it out behind him.
When Martin crossed the line, the celebrations began in the Pramac garage and amongst the many Spanish fans who had made the journey to the Circuit de Barcelona-Catalunya.
The race was due to take place in Valencia but had to be moved after the region suffered its worst floods in a generation which have killed more than 220 people.
The race was switched to Barcelona and has been dubbed the Solidarity GP to show support for the people of Valencia, with all proceeds of the event going to the Valencia relief fund.