The young Italian, contending for victory for much of the closely-fought 24-lap race, eventually crossed the line 3rd on his Mahindra MGP3O, to earn the Mapfre Team Mahindra squad's first podium of the season.
He took the flag less than half a second behind eventual winner Romano Fenati and just over three-tenths of a second behind second-placed Enea Bastianini to complete an all-Italian podium.
Bagnaia, who started the race from the front row of the grid in third, made a good getaway on his MGP3O, slotting into second behind a fast-starting Niccolo Antonelli before then seizing the lead from his compatriot in the early laps.
He was right back with the battling lead duo of Fenati and Bastianini before long, and surged into the lead in the closing laps of the race.
He held the lead as the trio crossed the line to begin the final lap but couldn't fend off Fenati's KTM and Bastianini's Honda.
The result was nonetheless Mahindra's first podium of the season and the first since the Indian manufacturer deepened its commitment to the sport by becoming a full-fledged constructor.