The West Africans twice had the lead but three extra time goals hand their European opponents the win and a spot in the semi-finals
Ivory Coast conceded three times in extra time to lose 5-2 against Spain to crash out of the Olympic Games in Tokyo on Saturday.
After Manchester United defender Eric Bailly gave the Ivorians the early lead, Dani Olmo hit back for Spain midway through the first half, but Max Gradel thought he'd scored the winner for the West Africans in added time, only for Rafa Mir to equalise and send the game to extra time.