Switzerland dealt a blow to their bid to qualify for the Nations League finals when they lost to Spain in their first home game in almost four years.
Portugal replaced Luis Enrique's side at the top of Group A2 and will play their winner-take-all final match on Tuesday.
The game was decided three minutes after Jordi Alba tied the game.
Switzerland had taken a 2-0 lead in Zaragoza.
Since losing to England in the Nations League, La Roja has lost in 22 matches.
Their only loss in their past 56 competitive home matches was against Switzerland.
Spain will head into their final game two points behind Portugal and needing all three points to progress after Portugal lost to the Czech Republic.
After picking up their first win against Portugal in June, Switzerland moved off the bottom of the group and onto the top.
As Breel Embolo attacked a second ball at a corner, Garcia's own- goal forced them to leapfrog the Czech Republic as they attempt to avoid the drop.