The Spaniard led by 13 seconds after the 10K classical leg of the event before sealing the win with a dominant performance in the freestyle portion.
Despite falling during the second leg, Muehlegg cruised home 28.5 seconds ahead of the field.
"I was thinking: you must ski, don't worry, you have 20 seconds ahead of the others. I knew I'm strong in skating, so it wasn't a problem," the 31-year-old said.
"When I passed the stadium for the first time I thought
'it's finished, they can't catch me now'"
"Today was the success of hard work. I know I am not the fastest skier or a good sprinter, but I have a good motor.
"When I passed the stadium for the first time I thought 'it's finished, they can't catch me now'."
The Norwegian pair of Thomas Alsgaard and Frode Estil crossed the finishing line together in a thrilling sprint.
The pair could not be split by a photo finish and were both given a the silver medal.
Alsgaard came back from 16th position after the classical 10K to share the spoils with his compatriot.
He lunged his left ski forward at the line to force a dead-heat and then collapsed after the finish.
The Norwegian team-mates had to wait several minutes to get the official decision.
"I don't mind sharing the medal with Frode," Alsgaard said.
"It was a big enough struggle just to catch him - it's the best thing that could've happened to us."
German-born Muehlegg won the 30K gold on Saturday, but says he will donate this medal to King Juan Carlos of Spain.
World Cup champion Per Elofsson of Sweden started 32.1 seconds behind Muehlegg and finished fourth after starting the freestyle portion in ninth.
It was the first time in the history of the Games that both events were held on the same day.