With both sides knowing a win would grant passage to the last 16, Nikola Vlasic arrowed the World Cup finalists into an early lead to silence the national stadium in Glasgow.
However, a thundering drive just before half-time from Callum McGregor caused the 12,000 fans to explode in a cacophony of hope.
But Luka Modric's sumptuous first-time shot after an hour broke Scotland and Ivan Perisic glanced in a third from a corner to record Croatia's first-ever win over the Scots.
The margin of victory was also enough to earn them second place in the group ahead of the Czech Republic on goals scored, with both those sides advancing to the last 16.
This was a typically Scottish occasion. An evening that almost defied logic, but made perfect sense to the thousands who assembled in Glasgow's south side. Thousands who had a dream of reaching the knockout stages of a major tournament for the first time.
It was a night where things had to be done the hard way. The Scottish way.
Pre-tournament, the best shot of a win looked like being against the Czechs. Instead, defeat was meted out. Next was arguably the toughest fixture, but heroism was the name of the day at Wembley, with Billy Gilmour the main protagonist.
So on to the team who made it to the last World Cup final, buoyed with dreams of a glorious Hampden win. A win which had to be garnered without Gilmour, who tested positive for Covid-19 on Monday.
Scotland also had to achieve the feat of scoring in the tournament. Twenty-eight shots had been sent goalward in the first two games, yet none sparked celebrations.
Within 10 seconds, the Scots were a team possessed in search of it, winning a corner immediately.
The early signs were good as Hampden reverberated with the buzz of a thousand Doh a Deers and Che Adams came agonisingly close to tapping in a teasing John McGinn ball across the face of goal. Maybe this was really happening?
Then the first blow came. While energy underpinned the point in London, a raking cross was allowed to be pinged to the Scottish back post. Perisic outjumped Stephen O'Donnell, with Vlasic bursting in to steer the ball home.
Hampden fell silent, the hush persisting as Scotland attempted to rally.
McGinn was again at the heart of it. The Aston Villa man dangled a cross towards the back post with no takers. It was recycled and, when it found its way back to him, a mistimed shot was nervously shuffled around a post by Dominik Livakovic. Another chance gone.
Grant Hanley hobbled off injured as Steve Clarke was forced into a reshuffle, Scott McKenna coming on and being instantly booked, such was the intensity of the Croatian surges forward with Modric pulling the strings.
But then, a nation roared as one. An Andy Robertson cross wasn't dealt with by the Croatian defence, and when it fell to McGregor, the Celtic man drove the ball into the bottom right corner through a corridor of flying bodies. Hampden heaved as McGregor celebrated riotously.
The second half started with fresh positivity, but it was to be unfounded for the Scots.
Within five minutes, Josko Gvardiol was denied one on one by David Marshall. The Scotland goalkeeper would come to his nation's aid moments later as Croatia cranked up the pressure.
Then, the sliding doors moment. Stuart Armstrong dropped his shoulder to loop in a gorgeous ball to the back post. McGinn appeared as if by magic but could not adjust his stride and somehow sent the ball wide from a matter of yards.
Just three minutes later, the Croats struck again. Modric was afforded time and space after a lay off from Mateo Kovacic, and with the outside of his right boot, the 35-year-old steered the ball into the net. Sublime.
As Scotland poured forward, the game was ended as a contest with 13 to play. Perisic surged to the front post at a corner and guided the ball in off the back post. Scotland's Euro dream was over.
As the whistle sounded for full-time, Hampden rocked to the noise of "We'll be coming down the road". Those fans will be hoping to see these likes again soon.
* Scotland have been eliminated in the group stages in all 11 of their appearances at major tournaments.
* Croatia have progressed from the group stages at three consecutive finals, having only done so in three of their first eight appearances.
* Croatia beat Scotland for the very first time in what was the sixth match between the two sides.
* Scotland have won only one of their last nine competitive matches (D4 L4), having won six of their previous eight (D2).
* Perisic has been directly involved in six goals in his last six Euros appearances, scoring four goals and assisting two more. His goal also made him Croatia's joint-top major finals goalscorer, equalling Davor Suker's nine goals.
* Modric became the oldest player to score for Croatia at the Euros (35 years and 286 days) - he already holds the record for Croatia's youngest at the tournament (22 years 73 days v Austria in 2008).
* Callum McGregor became the first Scottish player to score at the Euros since June 18, 1996, when Ally McCoist netted against Switzerland. Scotland had gone 46 shots without scoring in the competition.