The Spaniard, who has also started eight times in a row from pole position in Germany, was pushed hard by local hero Jonas Folger who finished a stirring second for the non-works Yamaha Tech3 team.
Folger, who started fifth, became the first German to stand on the podium in his home grand prix in the MotoGP era.
Grand Prix Germany
Marquez extends unbeaten Germany pole run
01/07/2017 AT 13:47
Dani Pedrosa, Marquez's team mate and compatriot, finished a distant third.
The win was triple champion Marquez's second of the season and sent him clear at the top with 129 points, five ahead of Yamaha's Maverick Vinales, who finished fourth and is on 124 after nine races.
Italian Andrea Dovizioso, the previous leader, slipped to third on 123 points after crossing the line in eighth place. Compatriot Valentino Rossi, who finished fifth, is fourth overall on 119 points.
Marquez's run of success at the Sachsenring, near Chemnitz, started in 2010 when he was competing in the 125cc category. He then won in Moto2 in 2011 and 2012 before his streak of five victories in MotoGP.
Grand Prix Germany
Barbera tops Sachsenring FP2 after showers
30/06/2017 AT 14:17
Motorcycling
Rossi announces decision to retire at end of season
05/08/2021 AT 14:45