Match ends, Scotland Women 1, Portugal Women 2.
Defeat by Portugal meant Scotland had to rely on England beating Spain on Sunday to retain their slim hope of advancing from Euro 2017 Group D.
Lana Clelland had squandered a simple chance for Scotland before Carolina Mendes pounced on a Vaila Barsley mistake to score after 27 minutes.
Substitute Erin Cuthbert curled in a cracking equaliser for Scotland.
Ana Leite replied quickly for Portugal, with a Caroline Weir effort that hit the post Scotland's closest response.
The match in Rotterdam was one Anna Signeul's team really had to win to have a good chance of being in the top two teams to progress from the group.
However, England's 2-0 victory over Spain keeps the Scots in it. They must now beat Spain by two goals in their final group game on Thursday and hope that England defeat Portugal, who lost 2-0 in their opening game against Spain.
In such a scenario, Scotland, Spain and Portugal would each have three points but Scotland would go through by dint of their better goal difference among the three tied teams, since the trio's goal difference against England would be discounted.
The top two sides from each group progressing to the quarter-finals.
Portugal, like Scotland, are playing in their first major finals, but they are ranked 38th in the world, 17 places below their opponents and had not beaten the Scots in 23 years.
Scotland head coach Signeul had said before kick-off that her team would play at a high tempo and focus on attacking Francisco Neto's team.
And her players began smartly, with Lisa Evans running at the Portugal defence and drawing a booking in the first minute for Carole Costa when she was hauled down.
Scotland were in control and enjoying the bulk of possession, with full-backs Rachel McLauchlan and Kirsty Smith advancing when the opportunity presented itself, and wide midfielder Fiona Brown threatening down the left wing.
But they spurned the simplest of chances when Weir's curler from the edge of the box was parried by Portugal goalkeeper Patricia Morais and Clelland, somehow, completely missed what ought to have been a tap-in from six yards.
Clelland, in the team as a replacement for the injured Jane Ross, immediately spun on to her left and hit the post with her subsequent effort but her pained expression told its own story.
She had another chance to score when Brown's cross was headed in her direction but she used her arm to control the ball and was penalised.
With Scotland in control, the game swung when Portugal scored in their first attack of note.
McLauchlan was unable to match the pace down the left wing of Diana Silva, whose cross was deflected towards Barsley. The Scotland defender miscued her clearance leaving Mendes the straightforward task of slipping the ball past the advancing Gemma Fay.
The goal transformed the Portugal team, orchestrated by their captain Claudia Neto. Suddenly, their passing was more accurate, their touch more assured.
That carried on into the second half, which was nine minutes old when Clelland was replaced by Chelsea midfielder Cuthbert.
Leanne Crichton smashed a drive wide of the target from 25 yards as Scotland pushed for the leveller.
If their previous attempts lacked guile, that could not be said of the equaliser.
Though surrounded by Portuguese players, 19-year-old Cuthbert managed to slide the ball to Weir and run on to the Liverpool midfielder's clever return before curling the ball around Morais.
Portugal responded bravely, with Silva's searing pace leaving McLauchlan in trouble. Her cutback was met by Mendes who knocked it past Fay's right-hand post.
But they quickly re-established their lead when a simple kick-out from Morais was head-flicked on, cutting through the dark blue defence. Barsley could not match the run by Leite and the Leverkusen striker dispatched the ball past Fay within two minutes of coming on as a substitute.
Scotland fought desperately, knowing that a point was the minimum that would give them a realistic hope of advancing.
Weir cracked a shot off the post and a last-gasp corner gave them hope but, ultimately, they fell to the lowest-ranked team in the tournament.
- 18McLauchlanSubstituted forLoveat 82'minutes
- 14CorsieBooked at 74mins
- 22BrownSubstituted forLauderat 67'minutes
- 19ClellandSubstituted forCuthbertat 54'minutes
- 12Sousa Barros MoraisBooked at 86mins
- 9Marques Borges
- 4García RebeloBooked at 76mins
- 15da Silva CostaBooked at 2mins
- 14Jácome Silva
- 11Ferreira Pinto
- 19Da CostaSubstituted forLira Piresat 76'minutes
- 7Pires NetoBooked at 89mins
- 18Trindade Coruche MendesSubstituted forOliveira Leiteat 70'minutes
- 16Abreu Sousa SilvaBooked at 47minsSubstituted forRamos Luísat 90+2'minutes
- 2Amaral Mendes
- 3Pega Infante
- 5Veiga Santiago Fidalgo
- 6Alexandra Norton
- 8Ramos Luís
- 10Oliveira Leite
- 13Figueira Pinto
- 20Lira Pires
- 21Ribeiro Gomes
- 22Campos Costa
- Katalin Kulcsár
- Shots on Target
Second Half ends, Scotland Women 1, Portugal Women 2.
Patricia Morais (Portugal Women) wins a free kick in the defensive half.
Foul by Rachel Corsie (Scotland Women).
Corner, Scotland Women. Conceded by Silvia Rebelo.
Offside, Portugal Women. Ana Leite tries a through ball, but Laura Luís is caught offside.
Attempt saved. Suzane Pires (Portugal Women) right footed shot from outside the box is saved in the bottom left corner. Assisted by Laura Luís.
Attempt missed. Ana Leite (Portugal Women) right footed shot from long range on the right misses to the right. Assisted by Vanessa Marques.
Attempt missed. Leanne Crichton (Scotland Women) right footed shot from the left side of the box misses to the right. Assisted by Kirsty Smith.
Attempt saved. Cláudia Neto (Portugal Women) right footed shot from outside the box is saved in the bottom left corner. Assisted by Dolores Silva.
Substitution, Portugal Women. Laura Luís replaces Diana Silva.
Cláudia Neto (Portugal Women).
Joanne Love (Scotland Women) wins a free kick in the defensive half.
Cláudia Neto (Portugal Women) is shown the yellow card for a bad foul.
Foul by Cláudia Neto (Portugal Women).
Rachel Corsie (Scotland Women) wins a free kick in the defensive half.
Offside, Scotland Women. Rachel Corsie tries a through ball, but Erin Cuthbert is caught offside.
Patricia Morais (Portugal Women) is shown the yellow card.
Caroline Weir (Scotland Women) hits the left post with a left footed shot from the centre of the box.
Attempt missed. Ana Leite (Portugal Women) right footed shot from outside the box is high and wide to the right.