Three-time European champions Spain had already secured top spot thanks to wins over Croatia and Italy, so coach Luis de la Fuente was able to make 10 changes to his starting line-up.
The substitutions he later made ensured every outfield player in their 26-man squad featured during their opening three matches.
Spain had won all eight of their previous encounters with Albania and never looked like losing in Dusseldorf, creating openings from the early stages.
Ex-Manchester City man Jesus Navas, now 38 and an attacking right-back, produced a fine cross and Mikel Merino, formerly of Newcastle, had an effort parried.
Joselu, a Champions League winner with Real Madrid after earlier spells with Stoke City and Newcastle, also went close before Spain’s first goal.
After Torres struck, Spain had chances to kill off the game but Olmo, Torres, Merino and Joselu missed opportunities.
Albania realistically needed to win to progress, but this loss, along with Italy’s 1-1 draw against Croatia, meant Sylvinho’s side ended up bottom of the group.
It also meant certain progression to the last-16 phase for England from Group C plus France and the Netherlands from Group D, with those three already having taken four points from two matches.
Those sides have loftier aims, but they will at worst feature among the four best third-placed finishers in the group stage, which is sufficient to advance.
Out of 24 nations at Euro 2024 only two – Spain and Portugal – have won all their matches, with Portugal playing their third group match on Wednesday when they face Georgia.
Spain will play their last-16 tie on Sunday in Cologne (20:00 BST) and will meet a third-placed finisher from one of Group A, D, E or F.