Although Croatia needed at least a point to secure a top-two finish, it was Portugal that seized control from the start, dominating possession and appearing more threatening, with the hosts merely looking to exploit counterattacks at any given opportunity.
The visitors eventually capitalised on their dominance when Vitinha played a long pass from defence to attack, sending the ball into the path of Joao Felix, who had broken past the Croatia defence and, after brilliantly controlling it with the outside of his right foot, fired his strike through Dominik Livakovic's legs and into the net, giving Portugal the lead after 33 minutes.
Croatia believed they had equalised just after the hour mark when Gvardiol headed in from close range, but the flag quickly went up to deny the hosts, however, just minutes later and Gvardiol did have his goal, this time sneaking in at the back post to meet Kristijan Jakic's cross and squeezing his shot past Jose Sa into the near corner.
The equaliser sparked the hosts into action for the remainder of the second half, as they controlled more of the ball and came close to taking the lead on several occasions, only for wasteful finishing and a series of superb saves from Sa denying them at the last moment.
With Scotland winning 2-1 in their match against Poland, Croatia could have opted to defend their crucial point, but it was the hosts that pushed for the winner in the final moments, with Ante Budimir hitting the post late in the game, but the final whistle eventually rang to ensure Zlatko Dalic's side finished second in the group.
CROATIA VS. PORTUGAL HIGHLIGHTS
Joao Felix goal vs. Croatia (33rd min, Croatia 0-1 Portugal)
That is sublime from Felix, the group leaders have gone ahead in Split!
Vitinha has possession in Portugal's defensive third and looks forward for passing options, choosing to play an arcing ball into the path of Felix, who has made a run beyond the Croatia defence and towards goal.
The Chelsea forward brings the ball into his path with a superb first touch using the outside of his right foot, takes another touch to drive into the penalty area, and fires a left-footed strike through Livakovic's legs and into the net.
Josko Gvardiol goal vs. Portugal (65th min, Croatia 1-1 Portugal)
Gvardiol has found the equaliser, Croatia are going through in second place as it stands!
Jakic has the ball on the right side, cuts onto his left foot, and delivers an inviting, curling cross that sails past everyone in the box and reaches the back post, where Gvardiol sneaks in unmarked.
The defender does not make the cleanest contact on his volley, with the ball rebounding directly into the floor, but it manages to squeeze its way past Sa at the near post and into the net, pulling Croatia level.
MAN OF THE MATCH - JOSKO GVARDIOL
Gvardiol has been in immense goalscoring form for a defender in recent matches, and he continued that run with Croatia's equalising goal just after the hour mark, bouncing his volley off the floor and narrowly past Sa at the near post.
The defender was unlucky to not have scored just minutes prior when he headed in from a similar cross, but the flag instantly deemed the goal to be offside and a brief VAR check confirmed the decision.
Portugal's Felix must also be given a mention, particularly for his superb showing in a first half that saw Portugal dominate the ball, with the forward creating plenty of threat for Croatia, including a fantastically taken opening goal.
CROATIA VS. PORTUGAL MATCH STATS
Possession: Croatia 43%-57% Portugal
Shots: Croatia 15-12 Portugal
Shots on target: Croatia 9-5 Portugal
Corners: Croatia 5-7 Portugal
Fouls: Croatia 8-8 Portugal
BEST STATS
WHAT NEXT?
Portugal were already guaranteed to place top of League A Group 1 before this game, but tonight's draw ensured that Roberto Martinez's men remained unbeaten in their six group matches, winning four and drawing two.
As for the hosts, they came into this game needing just a point to guarantee their progression from the group in second place regardless of Scotland's result, and they did exactly that, coming from behind to draw 1-1, meaning they advance to the quarter-finals.