Swiss shock favourites Spain
Spain came into the match with a swagger on the back of a perfect qualifying campaign, a run of 12 straight victories and as favourites to win the tournament.
GEAR: Get your Spain WC shirt
They departed the Moses Mabhida stadium potentially facing a tricky second round tie against five-times champions Brazil, newly-installed as favourites in their place.
Gelson Fernandes scored the scrappy winner in the 52nd minute and Spain, for all their talent and guile, were unable to find a way through the massed ranks of white Switzerland shirts.
"We tried in an orthodox way and in an heroic way but we were not able to score. It wasn't our day. We dominated almost all the match," Spain coach Vicente del Bosque said.
"This defeat means that we have to win the other two (group) matches," he added.
The Swiss, who have not conceded a World Cup goal since a 3-0 defeat to Spain in 1994, share the lead in Group H with Chile, who beat Honduras 1-0 earlier on Wednesday.
"It's a great feeling to start the tournament with three points against one of the biggest contenders for the title," said Switzerland's coach Ottmar Hitzfeld.
"These were three unexpected points and beyond that I was very pleased to see a strong performance by my team. I'm very happy, I'm very satisfied by this excellent start."
After a forgettable first half, the Swiss looked like spending another 45 minutes defending for their lives until goalkeeper Diego Benaglio's long punt caused chaos in the Spanish defence.
Goalkeeper Iker Casillas clashed with Swiss striker Eren Derdiyok and Gerard Pique was unable to stop the ball falling to Fernandes, who clipped it into an empty net.
"To be fair I'm not used to scoring goals so it was a surprise," the Cape Verde Islands-born midfielder told reporters. "It was a bit of luck you know."
The European champions enjoyed a near monopoly of possession for much of the game but were profligate in front of goal and unable to beat the impressive Benaglio.
Del Bosque, who had started the match with David Villa as a lone striker, brought forwards Fernando Torres, Jesus Navas and Pedro to try and rescue the game but a virtual siege of the Swiss penalty area failed to produce an equaliser.
Xabi Alonso hit the underside of the bar with a fine strike in the 70th minute, Navas shot lamely at Benaglio when through on goal about a minute later, and Pique squandered another chance on the next Spanish attack.
Derdiyok, playing in place of his injured captain Alex Frei, then jinked his way through the defence to almost double the Swiss lead but, to the relief of the Spanish, his shot came bouncing back off the post.
Torres had a couple more openings in the dying minutes of the game but failed to exploit them and, after five minutes of added time, the Swiss were able to celebrate a famous upset.