However, it was an unhappy day for his Repsol Honda team-mate Casey Stoner, who saw his championship lead cut by Factory Yamaha rival Jorge Lorenzo.
Stoner's advantage is down to fifteen points after defending champion Lorenzo was able to overtake him on the final corner and claim second place.
For Pedrosa it was a third win in total at the Sachsenring circuit in only his second race back on the track since suffering a broken collarbone.
His victory took him up to fifth in the championship standings, four points behind Valentino Rossi who finished ninth in Sunday's race.
Pedrosa recorded the fastest lap of the race - clocking one minute 21.846 seconds on lap 20 - and finished the race in a time of 41mins 12.482secs.
Lorenzo was 1.477secs further back and Stoner 0.91secs behind his Yamaha rival.
Pedrosa told BBC2: "It was an unbelievable race because the pace was so high all the time. The bike was working better at the end than in the beginning.
"I didn't expect this result at all so I'm very happy. I have to give my thanks to the doctors, the fans and all the people around me because they know how hard it was for me. To come back and win a race is an unbelievable feeling, so thanks to them and I hope I can continue like this."
Lorenzo added: "It was a fantastic race. I didn't know where I could find the force to keep pushing until the end. This race was very important and we are so proud and so happy."
Andrea Dovizioso ensured all three Repsol Honda machines finished in the top four as he climbed up from sixth on the grid. He is third in the overall standings, 32 points behind Stoner.
Seven-time world champion Rossi enjoyed an impressive day as he managed to recover from 16th on the grid to finish ninth.
The second half of the MotoGP season kicks off with the United States Grand Prix at Laguna Seca next weekend.