It was clear Spain’s window was closing, but few thought it would be Croatia to expose the two-time silver medalist’s aging roster.

Croatia had trailed for the majority of the game, but a Krunoslav Simon steal and fast-break layup with 1:25 remaining in the fourth quarter put the Croats ahead for the first time since the opening period.

From there Croatia would never give up the lead, though a Nikola Mirotic three with 16 seconds left brought Spain within striking distance. Pau Gasol had a chance to tie the game at the buzzer, but Dario Saric came up with the game-winning block to seal the upset.

Saric had struggled for most of the game, shooting 1-7 from the field, including 0-4 from beyond the arc. Instead, it was Bojan Bogdanovic who largely kept the upstart Croatians within reach. Bogdanovic, who plays for the Brooklyn Nets, finished with 23 points, 3 rebounds and an assist. Saric came up big when it mattered most though and finished with 5 points, 7 rebounds and 5 assists to go along with his crucial block.

Croatia only qualified for the Rio field last month after winning the Olympic Qualifying Tournament in Turin, Italy. Less than a month later they’ve pulled off what will likely be one of the more improbable upsets in the men’s basketball tournament.

Gasol had a game-high 26 points and 9 rebounds for Spain but received little help outside of Mirotic, who finished with 19 points, 6 rebounds, 3 assists and two steals. Spanish stalwarts Jose Calderon and Rudy Fernandez, each playing in their fourth Olympics, were held scoreless.

Croatia will have an opportunity to knock off another one of Olympic basketball’s old guard on Tuesday when they face Argentina. Spain will attempt to rebound against the host nation Brazil.