Luka Modric signed off his World Cup career with the consolation prize of a Qatar 2022 bronze medal as Croatia beat Morocco 2-1 in the third-place match on Saturday.
Goals of real wonder from Josko Gvardiol and Mislav Orsic meant the runners-up from four years ago in Russia finished this campaign on a high, following the blow of losing to Argentina in the semi-finals.
Croatia are hopeful captain Modric, at the age of 37, will decide to play on and take part in their Euro 2024 campaign, but this was a World Cup farewell for the Real Madrid midfielder.
Gvardiol gave Croatia a seventh-minute lead at Khalifa International Stadium. Although Achraf Dari swiftly brought Morocco level, Orsic's brilliant finish just before half-time proved to be the match winner.
Gvardiol's goal was a super header into the left corner after Lovro Majer's free-kick into the penalty area was skilfully nodded towards the penalty spot by Ivan Perisic.
Morocco were level just 112 seconds minutes later, though, with Dari applying a close-range finish with his head after Hakim Ziyech's free-kick from the right flank was sent looping up by a heavy touch off Croatia's Majer.
Yassine Bounou had almost sliced a pass into his own net early on, but the Morocco goalkeeper was sharp enough to keep out a low strike from Modric. However, he was beaten in the 42nd minute by an exquisite finish from Orsic, who arced the ball over the goalkeeper from just inside the left edge of the penalty area, the shot going in off the far post.
A deflected Orsic strike from 20 yards rippled the side-netting early in the second half as Croatia searched for a third goal against the team that became Africa's first World Cup semi-finalists.
Gvardiol later wanted a penalty after going down under a challenge from Sofyan Amrabat, before Morocco had their big chance, with Youssef En-Nesyri denied from close range by Dominik Livakovic. They were left to settle for fourth, still a huge achievement.