Muller, who scored five goals at the 2010 World Cup, was ruthless against a weak Portugal team that was clearly outplayed.
With Chancellor Angela Merkel supporting in the stands, the German team celebrated its 100th World Cup match with a rousing victory that virtually assured by halftime.
Muller scored either side of Mats Hummels’ headed goal as Germany took a 3-0 lead at the break, and added his third goal in the 81st.
Portugal was already 2-0 down before Pepe was red carded in the 37th minute for apparently head-butting Mueller when the German player was sitting on the ground.
It was Muller who opened the scoring in the 12th minute after Mario Goetze had been pulled down by Joao Pereira in the box, coolly slotting the penalty kick into the right corner of Rui Patricio’s goal.
Hummels had risen above Pepe to double Germany’s lead with a well-timed header from a corner in the 32nd, and Mueller extended the buffer just before the break when he stripped the ball from Bruno Alves and drilling in a low shot.
The Bayern Munich forward completed the rout late in the second half, poking in from close range after Patricio had fumbled a low cross from substitute Andre Schuerrle.
Cristiano Ronaldo started for Portugal at Arena Fonte Nova after overcoming a knee injury. He threatened early in the match, including a shot from a break that Germany goalkeeper Manuel Neuer could only block, but there was nobody from Portugal to pounce on the rebound.
Portugal also lost big striker Hugo Almeida to an injury. He was replaced by Eder in the 28th.
Fabio Coentrao injured a groin muscle and was helped off the field in 65th, to be replaced by Andre Almeida.
Hummels then limped off the field with a right-knee injury, giving substitute defender Shkodran Mustafi his second cap.