England stunned Spain 3-2 in the UEFA Nations League on Monday, earning payback for its opening loss against La Roja and staying in contention for a spot in the final four.

Raheem Sterling ended his three-year scoring drought with England with goals on each side of Marcus Rashford's strike before the break, and England held on from 3-0 to earn its first win in Spain since 1987.

More Images
England's Marcus Rashford, background, scores his side's second goal as Spain's Dani Carvajal tries to stop him during the UEFA Nations League soccer match between Spain and England at Benito Villamarin stadium, in Seville, Spain, Monday, Oct. 15, 2018. (AP PhotoMiguel Morenatti)

England stunned Spain 3-2 in the UEFA Nations League on Monday, earning payback for its opening loss against La Roja and staying in contention for a spot in the final four.

England's players celebrate the third goal of their team during the UEFA Nations League soccer match between Spain and England at Benito Villamarin stadium, in Seville, Spain, Monday, Oct. 15, 2018. (AP PhotoMiguel Morenatti)

Paco Alcacer scored Spain's first goal early in the second half and Sergio Ramos' claimed the second on the final play of the match.

England's players celebrate the third goal of their team during the UEFA Nations League soccer match between Spain and England at Benito Villamarin stadium, in Seville, Spain, Monday, Oct. 15, 2018. (AP PhotoMiguel Morenatti)

More AP soccer: https://apnews.com/tag/apf-Soccer and https://twitter.com/AP_Sports

Spain's Rodrigo reacts after the third goal of England during the UEFA Nations League soccer match between Spain and England at Benito Villamarin stadium, in Seville, Spain, Monday, Oct. 15, 2018. (AP PhotoMiguel Morenatti)

Spain's Rodrigo reacts after the third goal of England during the UEFA Nations League soccer match between Spain and England at Benito Villamarin stadium, in Seville, Spain, Monday, Oct. 15, 2018. (AP PhotoMiguel Morenatti)

England's Hary Kane controls the ball during the UEFA Nations League soccer match between Spain and England at Benito Villamarin stadium, in Seville, Spain, Monday, Oct. 15, 2018. (AP PhotoMiguel Morenatti)

England's Hary Kane controls the ball during the UEFA Nations League soccer match between Spain and England at Benito Villamarin stadium, in Seville, Spain, Monday, Oct. 15, 2018. (AP PhotoMiguel Morenatti)

Spain's coach Luis Enrique reacts during the UEFA Nations League soccer match between Spain and England at Benito Villamarin stadium, in Seville, Spain, Monday, Oct. 15, 2018. (AP PhotoMiguel Morenatti)

Spain's coach Luis Enrique reacts during the UEFA Nations League soccer match between Spain and England at Benito Villamarin stadium, in Seville, Spain, Monday, Oct. 15, 2018. (AP PhotoMiguel Morenatti)

Spain's coach Luis Enrique reacts during the UEFA Nations League soccer match between Spain and England at Benito Villamarin stadium, in Seville, Spain, Monday, Oct. 15, 2018. (AP PhotoMiguel Morenatti)

Spain's coach Luis Enrique reacts during the UEFA Nations League soccer match between Spain and England at Benito Villamarin stadium, in Seville, Spain, Monday, Oct. 15, 2018. (AP PhotoMiguel Morenatti)

Spain's Paco Alcacer scores his side's first goal during the UEFA Nations League soccer match between Spain and England at Benito Villamarin stadium, in Seville, Spain, Monday, Oct. 15, 2018. (AP PhotoMiguel Morenatti)

Spain's Paco Alcacer scores his side's first goal during the UEFA Nations League soccer match between Spain and England at Benito Villamarin stadium, in Seville, Spain, Monday, Oct. 15, 2018. (AP PhotoMiguel Morenatti)

Spain suffered its first loss in a competitive match at home since 2003 against Greece. It hadn't lost at home in 27 matches, and had not conceded three goals in a home match since 1991 against Hungary, lost 4-2.

England's Marcus Rashford, background, scores his side's second goal as Spain's Dani Carvajal tries to stop him during the UEFA Nations League soccer match between Spain and England at Benito Villamarin stadium, in Seville, Spain, Monday, Oct. 15, 2018. (AP PhotoMiguel Morenatti)

England's Marcus Rashford, background, scores his side's second goal as Spain's Dani Carvajal tries to stop him during the UEFA Nations League soccer match between Spain and England at Benito Villamarin stadium, in Seville, Spain, Monday, Oct. 15, 2018. (AP PhotoMiguel Morenatti)

Paco Alcacer scored Spain's first goal early in the second half and Sergio Ramos' claimed the second on the final play of the match.

Despite the loss, Spain stayed ahead in Group 4 of the top-tier League A with two more points than England after three matches. Croatia, with a game in hand, has one point.

Spain could have secured a spot in the last four with a win, while a draw would have ended England's chances of advancing. Only the group winner moves on.

England's players celebrate the third goal of their team during the UEFA Nations League soccer match between Spain and England at Benito Villamarin stadium, in Seville, Spain, Monday, Oct. 15, 2018. (AP PhotoMiguel Morenatti)

England's players celebrate the third goal of their team during the UEFA Nations League soccer match between Spain and England at Benito Villamarin stadium, in Seville, Spain, Monday, Oct. 15, 2018. (AP PhotoMiguel Morenatti)

More AP soccer: https://apnews.com/tag/apf-Soccer and https://twitter.com/AP_Sports

Tales Azzoni on Twitter: http://twitter.com/tazzoni

England's players celebrate the third goal of their team during the UEFA Nations League soccer match between Spain and England at Benito Villamarin stadium, in Seville, Spain, Monday, Oct. 15, 2018. (AP PhotoMiguel Morenatti)

England's players celebrate the third goal of their team during the UEFA Nations League soccer match between Spain and England at Benito Villamarin stadium, in Seville, Spain, Monday, Oct. 15, 2018. (AP PhotoMiguel Morenatti)

Spain's Rodrigo reacts after the third goal of England during the UEFA Nations League soccer match between Spain and England at Benito Villamarin stadium, in Seville, Spain, Monday, Oct. 15, 2018. (AP PhotoMiguel Morenatti)

Spain's Rodrigo reacts after the third goal of England during the UEFA Nations League soccer match between Spain and England at Benito Villamarin stadium, in Seville, Spain, Monday, Oct. 15, 2018. (AP PhotoMiguel Morenatti)

England's Hary Kane controls the ball during the UEFA Nations League soccer match between Spain and England at Benito Villamarin stadium, in Seville, Spain, Monday, Oct. 15, 2018. (AP PhotoMiguel Morenatti)

England's Hary Kane controls the ball during the UEFA Nations League soccer match between Spain and England at Benito Villamarin stadium, in Seville, Spain, Monday, Oct. 15, 2018. (AP PhotoMiguel Morenatti)

Spain's coach Luis Enrique reacts during the UEFA Nations League soccer match between Spain and England at Benito Villamarin stadium, in Seville, Spain, Monday, Oct. 15, 2018. (AP PhotoMiguel Morenatti)

Spain's coach Luis Enrique reacts during the UEFA Nations League soccer match between Spain and England at Benito Villamarin stadium, in Seville, Spain, Monday, Oct. 15, 2018. (AP PhotoMiguel Morenatti)

Spain's coach Luis Enrique reacts during the UEFA Nations League soccer match between Spain and England at Benito Villamarin stadium, in Seville, Spain, Monday, Oct. 15, 2018. (AP PhotoMiguel Morenatti)

Spain's coach Luis Enrique reacts during the UEFA Nations League soccer match between Spain and England at Benito Villamarin stadium, in Seville, Spain, Monday, Oct. 15, 2018. (AP PhotoMiguel Morenatti)

Spain's Paco Alcacer scores his side's first goal during the UEFA Nations League soccer match between Spain and England at Benito Villamarin stadium, in Seville, Spain, Monday, Oct. 15, 2018. (AP PhotoMiguel Morenatti)

Spain's Paco Alcacer scores his side's first goal during the UEFA Nations League soccer match between Spain and England at Benito Villamarin stadium, in Seville, Spain, Monday, Oct. 15, 2018. (AP PhotoMiguel Morenatti)