Luis Enrique's side looked fairly comfortable in the first half, and looked well on their way to victory when Denis Zakaria's own-goal gifted them the lead within ten minutes.
Barcelona's Jordi Alba connected well with a corner at the edge of the box, before a wicked deflection from Zakaria sent the ball soaring past a despairing Yann Sommer for the tournament's 10th own-goal.
Spain came close to doubling their lead from another corner in the 25th minute. Cezar Azpilicueta rose highest to meet Ferran Torres' cross, but luckily for Sommer, the effort this landed neatly in his grasp.
Switzerland carved their first real chance of the match just after the hour mark when substitute Ruben Vargas found Steven Zuber in the box. However, his stretching effort at the front post was equally met by Unai Simon in goal.
Just four minutes later, Xherdan Shaqiri etched his name onto another scoresheet- a mix-up by defensive duo, Pau Torres and Aymeric Laporte, meant the ball fell kindly for the Liverpool forward who calmly slotted home the equaliser.
Remo Freuler left Switzerland a man down in the 77th minute when his challenge on Gerard Moreno was immediately met with a red card.
Spain pushed for a winner, but the 10-men of Switzerland remained stubborn in defence, meaning both sides entered their second lot of extra time in a week to decide the game.
Moreno was immediately handed a chance to give Spain the lead just two minutes into extra time, but he guided Danny Olmo's cross wide of the goal from yards out.
With 101 minutes on the clock, Moreno had another huge chance to snatch a winner, but Sommer heroically came off his line to deny Spain the lead once again.
Despite creating a plethora of chances in extra time, Spain failed to beat an inspired Sommer between the sticks, and the match was to be decided by a penalty shoot-out.
Sergio Busquets managed to finally send Sommer the wrong way, but his penalty fired back off the post. Meanwhile, Mario Gavranovic scored to give Switzerland an early lead.
Danny Olmo crucially scored Spain's second penalty, while Simon saved Fabian Schar's tame effort to level the shootout 1-1.
Manchester City's Rodri saw his penalty saved by Sommer, but had his blushes partially spared when Simon saved Manuel Akanji's effort.
Moreno then found the back of the net in style, before Vargas sailed his shot over the bar. Match point.
It was Mikel Oyarzabal who stepped up to the spot for the Spaniards, and his cool finish into the bottom corner sent his side through to the semi-finals.
Stat of the day
From OptaJoe: Since the 2014 World Cup, only four European players - Ivan Perisic (9), Romelu Lukaku (10), Antoine Griezmann (11) and Cristiano Ronaldo (13) - have netted more major tournament goals (EURO/World Cup) than Xherdan Shaqiri (8).
Spain's semi-final clash is set to take place on Tuesday 6 July, at Wembley Stadium.
In what promises to be a clash of the titans, Spain will hope to reach the Euros final where they can then aim to build on their record three wins of the competition.
A win for the Three Lions would see them progress to their first semi-final since 1996, which is set to be played at Wembley Stadium.
But standing in their way, is Andriy Shevchenko's Ukraine, who have reached the quarter-finals for the first time in their nation's history.