Italy script Spain's first loss since World Cup win
Early second-half goals by Valentina Giacinti, Michela Cambiaghi and Elena Linari helped Italy offset Group 4 topper Spain's 12th-minute goal through Athenea del Castillo.
Italy weathered a late Esther Gonzalez strike to end Spain's eight-match winning streak.
Spain coach Montse Tome had made six changes to the side that beat bottom side Switzerland 7-1 in October to ensure a Nations League semi-final berth.
Nations League finalists also qualify for next year's summer Olympics in Paris.
Italy have equalled second-placed Sweden at seven points from five games in a race to avoid a relegation play-off.
Sweden will visit Spain on December 5 while Italy will host already-relegated Switzerland in their last group fixtures.