Spain twice came from behind against Greece, before David Silva scored an injury-time winner.
Silva popped up to score his second in the third minute of added time at the end of the game to give Spain a narrow 3-2 victory.
Carlos Marchena (38) cancelled out Theofanis Gekas' 19th minute opener but Greece went in ahead at half-time thanks to Kostas Katsouranis' strike just before the break.
Silva stole the show in the second half as he first pulled Luis Aragones' side level after 66 minutes.
The Valencia striker then lobbed goalkeeper Costas Chalkias in stoppage time to give Spain the friendly win.