The game was settled in the 117th minute of the game when second half substitute Ricardo Quaresma scored moments after Ivan Perisic had hit the post for Croatia.
During normal time the game was very dull with very little chances being created which sent the game to extra time.
The win means that Portugal will play Poland in the quarter-finals on Thursday in Marseilles.
The first half was a bit of a damp squid
The game began with both teams being very cagey and trying to see how each other were going to play the game from the start.
The caginess continued until midway through the first half when Portugal created the first chance of the game when Raphaël Guerreiro floated a lovely free-kick into Pepe but the defender headed the ball over the bar when he should have done better.
Portugal's chance looked like it was going to open the game up a bit as Croatia then created their first chance of the game when Perišić dribbled his way into the box and unleashed a left-footed shot which just went wide of Rui Patricio's goal.
The problem though was apart from these two chances both teams failed to gather any momentum during the half and were left frustrated as it was really a battle in midfield that no team got the better off.
The second half promised so much but it was more of the same
The second half began much better with Croatia straight away on the front foot and they could have gone in front when Marcelo Brozović found himself in space inside the box from a well-taken corner, but he rushed his shot and went way over the bar.
Croatia then had another good chance to take the lead when a lovely free-kick delivery from Darijo Srna found defender Damagoj Vida unmarked in the box. The defender though put his header wide when he should have at least got it on target.
Portugal pressed hard after Croatia created a couple of chances, but unfortunately they just couldn't find a way passed a stubborn Croatia defence as both teams didn't manage a single shot on target during normal time.
This meant that with both teams being unable to settle it in 90 minutes the game would need an extra 30 minutes and maybe penalties to settle the game.
The first half of extra time came and went in the blink of an eye still with no shot on target as both set sof players were unable to create that one moment of magic that could win their side the game.
Croatia had a chance to win the game in the second half of extra time when Portugal goalkeeper Patricio misjudged a corner kick and fell to the ground and with the goal at his mercy Vida somehow put his header over the bar.
Quaresma scores winner three minutes before the end of extra time
A goal did finally come three minutes before the end of the game and it went Portugal's way but not before Croatia hit the post when Perisic headed a cross on to the post.
The goal itself came when Luis Nani played a lovely ball into the path of Cristiano Ronaldo, who saw his shot saved by Croatia goalkeeper Danijel Subašić, but it went straight to Quaresma who headed the ball into an empty net to break Croatia's hearts and send Portugal into the quarter-finals where they will play Poland.