Wales fell just short of ending their Nations League group stage with a marquee win as reigning champions Portugal edged a five-goal thriller to triumph in Cardiff.
Wales were already guaranteed to finish bottom of Group A4 – albeit with a relegation play-off in March to keep their place in the top tier – but there was no hint of this being a dead rubber as Craig Bellamy's side dazzled in a blistering encounter.
In their second match since the international retirement of the great Cristiano Ronaldo, Portugal led through Bruno Fernandes' fine curling effort after Josh Sheehan had given the ball away to Joao Neves.
Wales equalised two minutes later as the impressive Rubin Colwill set up David Brooks for a smart first-time finish.
Bold and enterprising, the home side showed no fear as they played their way out of trouble and attacked from all directions to rattle their star-studded opponents.
Wales created a glut of chances before taking a deserved first-half lead as Sorba Thomas scampered clear to finish from Brooks' through ball, only for Portugal to level before the break as Pedro Neto volleyed in from Francisco Trincao's cross.
Although Wales continued to press and had opportunities to regain the lead, Portugal pounced on another defensive lapse – this time a loose header from Ben Cabango – as substitute Carlos Forbs fired into the bottom corner.
The visitors were soon down to 10 men after Chelsea's Neto picked up two yellow cards in two minutes to see red, but Wales could not take advantage, despite their valiant efforts.
As group winners, Portugal will advance to the Nations League quarter-finals in March, with the draw to come on Friday.
On the same day, Wales will discover which Group B runners-up they will face in their two-leg relegation play-off.