Updated

David Villa converted a penalty kick to set a Spanish record with his 45th goal, and second-half substitute Fernando Llorente got the tiebreaker in the 79th minute of a 3-2 victory over Scotland in European Championship qualifying Tuesday night.

Villa scored in the 44th minute after defender Steven Whittaker handled the ball in the penalty area. Villa moved past Raul Gonzalez on Spain's career scoring list.

Andres Iniesta made it 2-0 in the 55th, but Scotland tied it on Steven Naismith's goal in the 58th and an own goal by Gerard Pique eight minutes later.

Llorente entered in the 76th, and his goal gave the defending world and European champions a 17th consecutive qualifying win in all competitions.

Spain is 3-0 for nine points in Group I, while Scotland (1-2-1) has four points from four games.