The 28-year-old, who had previously managed just one win on the World Cup circuit, to go with a win and podium so far, won with a combined time of 2 minutes 45.20 seconds, after one downhill and one slalom run.
Croatia’s Ivica Kostelic was second at 0.34 seconds, bagging his fourth Olympic silver – three of which have come in the combined.
Taking third place and the bronze was Christof Innerhofer at 0.47 seconds, as the Italian continued what has been a successful Sochi 2014, following his silver in the downhill.
“This is amazing, it's perfect, it's more than a dream come true,” Viletta said. "It's also a big shock. I didn't think I would come first. I'm so happy.”
The Swiss was just 14th after the downhill and nowhere near the top favourites to win, but a second-fastest run in the slalom secured him gold.
Meanwhile, silver medallist Kostelic admitted to slight disappointment at missing out on top spot on the podium.
“I was hoping for the gold this time,” said the Croatian, but he added that capping an indifferent season with an Olympic medal was still a wonderful achievement.
“A big rock has fallen from my heart now... I had a pretty bad season. I never skied the podium in the World Cup so I am thankful for the medal.”
Ted Ligety of the US and Frenchman Alexis Pinturault had both been hotly tipped for glory ahead of the event, following impressive victories in the super combined during the World Cup season. However, neither managed to finish within the top 10.
Ligety, who needed a clean slalom after finishing 18th in the morning's downhill, made a costly mistake and ended up 12th, while the 22-year-old Frenchman failed to complete.
The American refused to accept that difficult conditions were to blame for his showing. “We all have to ski and deal with it,” he said. “There are no excuses.”
Ligety's compatriot and defending Olympic champion Bode Miller, who was seeking to make up for a disappointing eighth place in the downhill, fought hard to come back from a 12th place after the downhill run but had to make do with sixth overall.