A masterclass in counter-attacking football ensured Spain defeated their spirited neighbours in a high-quality contest between two talented units.
Saul breaks the deadlock after positive Portuguese opening
Arguably two of the most technically gifted sides in the competition, this was a critical game for both teams in their quest to top the group and earn automatic qualification. Portugal looked to press their neighbours from the outset and the first opportunity of the game fell to Bruno Fernandes who blazed over from distance.
Employing a short and fluid passing game, Portugal were not against efforts from range and they were inches away from opening the scoring from such a position. Daniel Podence smashed an effort from outside the box across goal and cracked the post with Kepa Arrizabalaga beaten.
Yet Macedonia learnt the hard way that you cannot give Spain any opportunities and not take yours when you are competing against the European giants and Portugal were made to pay on 21 minutes. Albert Celades' side had a key outlet in Hector Bellerin on the right and he fed Saul Niguez before the central midfielder weaved a moment of magic. Drifting past four players and hitting a deflected effort off the fifth, the ball spun out of reach from Bruno Varela and into the back of the net.
Spain settle into the contest
Portugal looked to strike back immediately but they continued to be subjected to long range efforts. Goncalo Guedes hit a snapshot wide before Fernandes picked out Kepa from distance after a quick free-kick.
Building more possession since their goal, Spain began to look dangerous on the counter-attack. Gerard Deulofeu switched to the left and curled an ambitious effort from the corner of the box just wide.
After another period of soaking up pressure, the quiet Marcos Asensio produced an excellent weighted ball into the path of Bellerin. With the full-back bearing down on goal, Varela was fast to react and spread himself wide to thwart Bellerin's strike. Moments later, Sandro Ramirez drove a shot just over from range and followed that strike with a dragged effort wide.
Portugal ended the half with some sharp interchanges but the best they could muster was a weak Podence effort straight at Kepa before they left the pitch a goal behind.
Portugal turn up the hear in their quest for an equaliser
Portugal were keen not to begin the second half dispirited and they tested Kepa just two minutes after the break. Deulofeu gave the ball away and Fernandes struck an effort straight at the goalkeeper but a slight deviation forced Kepa to knock the ball away with his feet.
The left was proving to be an outlet for Portugal and Jorge Mere was caught in possession by Podence on that side. The winger drove towards goal only to drift his effort just wide.
Yet, as was the case with the opener, Portugal were almost made to pay immediately. A sharp break from Spain resulted in the ball falling to Asensio and his strike beat Varela only to be cleared off the line by Edgar Ie.
Renato Sanches had been disappointingly quiet up until the hour mark. When a cross looped up in the air, the midfielder saw the headlines and unleashed a technical volley only to pick out Kepa from the edge of the box. He then snatched an even more ambitious effort wide just moments later.
Bruma thunderbolt proves just a consolation
However, Spain always looked threatening on the break and they took advantage to double their lead midway through the half. Deulofeu latched onto a through ball and picked out Sandro before the striker linked with Everton clipped the ball home from the near post.
Frustration grew for Portugal as Spain grew in confidence on the ball. Losing captain Fernandes was booked for a rash challenge to earn a suspension before lashing an effort wide.
The Portuguese substitutes looked to make a difference as Ricardo Horta sent Kepa scrambling with a deflected effort just off-target. Yet it was the introduction of Bruma that made the difference. As a cross was cleared, the winger unleashed a rasping 25-yard volley to score a screamer and get his nation back into the game.
The game was now on a knife-edge and another substitute almost had an instant impact. Denis Suarez replaced Deulofeu to protect Spain but clipped an effort just wide after a beautifully crafted reverse pass from Asensio.
Yet Portugal were disappointing in their response after Bruma's spark and Inaki Williams was able to seal the outcome with the last kick of the game. The speedy striker broke away on the halfway line and used his pace to bear down on goal and slot the ball into the bottom corner.
The result leaves Spain just a point away from the knockout stages, whilst Portugal must regroup after their 21-game unbeaten streak was abruptly ended.