Spain have World Cup qualification in their own hands going into the final round of games after winning 1-0 in Greece.
Luis Enrique's side took advantage of a surprise slip from previous Group B leaders Sweden, who lost 2-0 in Georgia earlier on Thursday, to leapfrog them into first place.
Spain had never lost away to Greece in four previous meetings, and a first-half penalty from Pablo Sarabia increased that record to four wins and one draw.
They will book their place at Qatar 2022 if they can avoid defeat to Sweden on Sunday in Seville.
The visitors unsurprisingly dominated possession but created little early on against a well-organised Greece.
The home side thought they had taken the lead on 21 minutes as Giorgos Masouras finished well from a Thanasis Androutsos throughball, but the Olympiakos forward was offside.
Just three minutes later, Spain were awarded a penalty after Inigo Martinez was felled in the box by Dimitris Giannoulis following a corner, and Sarabia sent Odisseas Vlachodimos the wrong way to put La Roja ahead.
The hosts needed a win to keep alive any hopes of qualification themselves and started to gamble a little more towards the end of the game, but Spain remained relatively calm as they eased to a vital win in Athens.