Two-time world champion Jorge Lorenzo claimed his eighth victory of the season, but it wasn't enough to overturn Marquez's 13-point lead which he held heading into the race.
In the end there was just four points between them.
Marquez's Repsol Honda teammate Dani Pedrosa finished second.
"I cannot explain what I feel, (it is) a dream come true," said Marquez.
"Maybe I was clear too early (in the season) and then Jorge came charging at the end and I had to keep my nerve in the final race. I am overjoyed."
More From This Section
Pedrosa then also moved past Marquez and an incredible battle between Pedrosa and Lorenzo ensued as the latter tried to bunch the leading pack in an attempt to increase Marquez's chances of sliding down the field.
However, his plan backfired as both Lorenzo and Pedrosa ran wide and allowed Marquez to briefly move in front.
Lorenzo then retook the lead with unerring ease, but Marquez cruised round in second before allowing Pedrosa to pass with five laps remaining to ensure there was no late drama.
"It was a bit of a different race because I wasn't trying to escape early on. I have to apologise to Dani because the two of us nearly crashed at one point and it was bit of a risky move on my part.
"I couldn't do any more. Once I saw that Dani and Marc had moved away from the rest, I just tried to win the race.
"We have tried until the end, it wasn't to be but at least it was not for the want of trying.