Torres, who was given the starting nod ahead of Cesc Fabregas, provided that lead in the fourth minute with a superb goal.
Spain controlled the match with their trademark precise passing and doubled their lead four minutes into the second half.
Torres scored third goal 20 minutes from time before Fabregas lashed the ball home from a tight angle off the far post in the 83rd minute.
The win puts Spain on top of the Group C along with Croatia, which earlier in the day drew 1-1 with Italy (two points). Ireland (zero points) is the first team eliminated from the quarterfinal round.