Enea Bastianini wins MotoGP British Grand Prix at Silverstone
Having qualified second on the grid, Bagnaia had taken the lead over pole-sitter Aleix Espargaro on the opening lap but found himself in the battle for third in the second part of the race after Martin overtook him with eight laps to go.
Martin, who had shown promising pace throughout the weekend, then looked on course to victory but made a costly mistake in the final moments, with Bastianini capitalizing after qualifying third.
Six-times MotoGP champion Marc Marquez had started seventh but rode his Gresini Racing bike with purpose to finish fourth.
Martin now leads the championship by three points, with reigning champion Bagnaia dropping to second place and Bastianini maintaining his hold on third. Marquez sits fourth in the table.