Manchester City forward Torres capitalised on two first-half assists from Mikel Oyarzabal to help halt the European champions’ world-record unbeaten run at 37 games.
Italy, who played more than half of the match a man down at the San Siro after captain Leonardo Bonucci was dismissed for two yellow cards, set up a tense finish thanks to an 83rd-minute goal from substitute Lorenzo Pellegrini.
But Spain held on to progress to Sunday’s final against either Belgium or world champions France.
Bonucci’s costly second indiscretion – a raised arm into the neck of Sergio Busquets, having earlier been cautioned for dissent – came in the 42nd minute with his team 1-0 down.
Federico Bernardeschi had at that stage been denied an equaliser by a combination of Spain goalkeeper Unai Simon and a post, while Lorenzo Insigne squandered a golden chance to level by blazing off target with the goal gaping.
Federico Chiesa also struck the woodwork in the second period before giving the diminished hosts late hope by teeing up Pellegrini’s consolation.
A slight concern for Luis Enrique’s visitors was the sight of in-form Torres – who has now scored 12 international goals in 21 appearances – being replaced early in the second period due to an apparent injury.
The two nations took to the field exactly three months on from their pulsating European Championship encounter at Wembley, which Italy ultimately edged on penalties following a 1-1 draw.
Robert Mancini made two changes to the team which began the subsequent final success over England, with Alessandro Bastoni preferred to Giorgio Chiellini in defence, while Bernardeschi replaced the injured Ciro Immobile in attack.
Meanwhile, Spain’s starting XI included a debut for Barcelona midfielder Gavi, who became his country’s youngest senior international at the age of 17 years and 62 days, breaking a record held by Angel Zubieta since 1936.
Chiesa tested Simon from range early on but the away side were far more threatening in the opening exchanges and went ahead with 17 minutes played.
Slick build-up play led to Oyarzabal – who minutes earlier had been denied by a crucial block from Bastoni – finding space on the left to deliver an inviting cross for the onrushing Torres to unconventionally volley home via the right post.
Italy goalkeeper Gianluigi Donnarumma was being jeered by sections of the home support after leaving AC Milan in acrimonious circumstances to join Paris St Germain in the summer.
And he very nearly gifted the Spaniards a quick-fire second. Marcos Alonso’s stinging effort squirmed through the hands of the 22-year-old before rebounding off the left upright and superbly cleared by Bonucci.
Italy’s lengthy streak without defeat stretched back more than three years. With the clock ticking towards the interval, they began to stretch their opponents’ defence.
Bernardeschi’s low effort was pushed on to the right post by Simon, before the unmarked Insigne – on the occasion of his 50th cap – somehow fired wide with the goal gaping after being set up by Emerson Palmieri.
But the momentum quickly swung back Spain’s way as Bonucci was sent for an early bath by Russian referee Sergei Karasev.
Spain swiftly took advantage of the red card to double their advantage two minutes into first-half added time.
The dangerous Oyarzabal was again the provider, seizing on Pablo Sarabia’s clever knock down to lift a perfectly-weighted ball across for Torres to expertly nod back into the left corner.
Bernardeschi was sacrificed for the second period in favour of veteran Italian Chiellini, while Torres soon went off to be replaced by Yeremi Pino.
Spain looked relatively comfortable for much of the second period but Chiesa gave them a warning by rattling the right post just after the hour mark.
Oyarzabal then wasted two good chances to put the result beyond doubt, before Italy halved the deficit with a counter-attacking goal following a Spain corner.
A weak header from Pino allowed Chiesa to steal the ball ahead of Pau Torres close to the halfway line and he galloped forward before unselfishly teeing up Pellegrini.
However, it was too little too late as Spain became the first team to defeat Italy at the San Siro.