The 21-year-old Honda rider became the first since Italian Giacomo Agostini in 1970 to win the first nine races of a season. Agostini won the opening 10 races that year.
In an unusual start, more than half of the field lined up at the pitlane exit after leaving it late to switch from wet tyres to slicks.
That left Germany's Stefan Bradl, who had put on the dry weather tyres before the formation lap, alone on the front row of the grid and followed at some distance by a bunch of backmarkers.
Marquez, who last year became the youngest ever MotoGP champion, had qualified on pole but had to fight through from 10th before taking the lead after six laps and then pulling away comfortably.
The Spaniard has now won in Germany for the last five years - in 125cc in 2010, Moto2 in 2011 and 2012 and then the top category.
Marquez's Repsol Honda team mate and compatriot Dani Pedrosa finished second, 1.466 seconds behind, with double world champion Jorge Lorenzo completing an all-Spanish podium with third for Yamaha.
Marquez now has 225 points to Pedrosa's 148.
Italian Valentino Rossi finished fourth on the other works Yamaha.