The Atlas Lions missed out on history as Croatia claimed their second medal in successive World Cups.
Morocco missed the chance to become the first African country to claim a medal at the World Cup after losing 2-1 to Croatia in the third-place match of Qatar 2022.
The Atlas Lions had been the surprise package of the tournament after seeing off the likes of Belgium, Spain, Portugal before losing to France in the semi-final.
But despite their loss to the defending champions, they were hoping to end their tournament on a high in the third-place match against Croatia, who had lost to Argentina in the semi-final.
Both teams trade goals but Orisic's strike is the difference
The third-place game is a match no team likes to play, but Croatia and Morocco took the game seriously.
Both coaches have made changes to the team that lost in the semi-final, with Croatia making five changes, and Morocco making three, but it was still a strong line-up from both teams.
Both sides were no strangers to each other, going into the game, having met in their group opener 24 days ago. That match ended in a boring goalless draw, but there was nothing boring about their encounter on Saturday evening.
Croatia started on the front foot, with the Chequered Ones attacking from the start. Their fast start paid dividends as they took the lead in the ninth minute through Josko Gvardiol.
The RB Leipzig man headed in brilliantly following a brilliant headed assist from Ivan Perisic after a superb set-piece routine.
However, Morocco responded instantly through Achraf Dari, who headed home from close range following free-kick from Hakim Ziyech.
The game continued to open up, with Croatia coming closest to restoring their lead again. The 2018 World Cup runners-up came close twice after a mistake from Morocco, but Yassine Bounou denied them on both occasions.
But Morocco were also dangerous going forward, with Sofiane Boufal causing trouble for the Croatian defence.
However, just as it looked like Walid Regragui's men were getting a stronghold, Croatia restored their lead through a moment of beauty from Misla Orsic.
The Dinamo Zagreb star, who is no stranger to scoring on the biggest stages, put Croatia ahead with a stunning effort from the edge of the box, leaving Bounou helpless.
Orsic's strike proved to be the last chance of the the opening half, with Croatia taking a 2-1 lead into half-time.
Morocco's fail to find an equaliser
The second half with Croatia starting again on the front foot. Zlatko Dalic's men almost extended their lead through Ivan Perisic, but the Spurs man could not direct his shot on target.
The Chequered Ones always looked dangerous anytime they go forward, although they were helped by Morocco's errors at the back.
Morocco manager Regragui tried to salvage the situation by making a raft of substitutions, but they were unable to trouble Croatia.
Moments later, Croatia had penalty shouts after Gavrdiol was tripped in the box, but the referee waved away the youngster's appeal.
The let-off woke Morocco up, but despite creating two big chances in quick succession, they could not get past Dominik Livakovic in Croatia's goal.
Croatia had the chance to wrap up the match minutes later, Kovacic could not find the target after brilliantly getting past Sofyan Amrabat.
The miss almost proved costly as El-Nesyri almost sent the tie into extra-time, but his header from a cross went just slightly over the bar.
It turned out to be last chance of the game as Croatia claim a 2-1 victory to win the bronze medal after a silver medal four years ago.