The 26-year-old Ducati rider had been assured of the championship when his sole rival Jorge Martin crashed early in the race.
Bagnaia was leading at the time on his Ducati unaware that Martin had come to grief after his Ducati-Pramac clipped Marc Marquez's Honda resulting in both of the riders coming to grief.
Martin walked off shaking his hands in frustration whilst six-time champion Marquez limped away in what was his final race for Honda.
Martin in tears
Martin returned to the pitlane where he burst into tears and was embraced by his team members.
The 25-year-old Spaniard had made an excellent start surging from sixth on the grid to second and pressuring Bagnaia.
However, on the second lap Martin clipped Bagnaia's bike and although he averted total disaster he dropped down to eighth spot.
A few laps later, though, he was unable to save himself a second time and the title was delivered into 26-year-old Bagnaia's hands.
Bagnaia rode a perfect race by contrast and regained the lead after Jack Miller crashed spectacularly.
Although last week's Qatar victor Fabio Di Giannantonio challenged him Bagnaia held his nerve and eased over the line, punching the air in delight.
After climbing off his bike he proceeded to slam dunk a basketball and then put three gold rings onto his fingers.
It is the second successive year Bagnaia has won the title on the final day -- Martin had reduced his lead to just 14 points on Saturday with victory in the sprint race.