A 93rd-minute header from Bruno Alves gave Portugal an unconvincing 1-0 win over Mexico on Friday.
The Fenerbahce defender found himself free at a late Joao Moutinho set-piece at the Gillette Stadium in Foxborough and headed past a helpless Guillermo Ochoa.
With Cristiano Ronaldo still missing due to injury, Paulo Bento's men had lacked a creative spark until the late winner.
Portugal, who were held to a 0-0 draw by Greece last time out, face the Republic of Ireland on Tuesday before their World Cup campaign begins against Germany on June 16.
As expected, Portugal were without key trio Ronaldo, Pepe and Raul Meireles in Massachusetts.
Miguel Herrera started with Manchester United striker Javier Hernandez on the bench, while Rafael Marquez – who had been under an injury cloud – returned to the centre of defence.
Mexico pressed high up the pitch early on, but Portugal created an opportunity in the 14th minute as Vieirinha's strike was kept out by Jose de Jesus Corona.
Portugal forward Eder had the best chance of the first half when he was played through, but Mexico scrambled the danger away with Corona swatting the ball away.
Eduardo was forced into a save in the Portugal goal soon after as he tipped away a goal-bound cross from the left.
Eder looked the most likely to score in an uninspiring first half and he had another chance six minutes before the break, only to put Joao Pereira's cross wide.
Bento's men almost took the lead in the 50th minute.
A Nani corner eventually fell to Fabio Coentrao in the area, but the Real Madrid defender's low strike was kept out by substitute goalkeeper Guillermo Ochoa at his near post.
Just five minutes later, Mexico almost found an unlikely opener from range.
Hector Herrera played a square pass to Andres Guardado, whose powerful 25-yard drive went inches wide.
Hernandez needed just three minutes to have an impact off the bench as he almost set up Hector Herrera a minute after the hour-mark.
The striker's cross to the back post from the left found the Porto man, who took a neat touch before forcing Eduardo into a strong save from an angle.
The lively Hector Herrera tried his luck from range in the 68th minute, and Eduardo was up to the task once more to deny him.
Hernandez set up substitute Alan Pulido for a glorious chance in the 89th minute.
Played in behind, Hernandez unselfishly squared for Pulido, but Eduardo was quick off his line to smother at the forward's feet in a one-on-one.
But there was to be late drama as slack marking saw Alves rise in the area to head in Moutinho's free-kick from the right.
Mexico had their moments ahead of their first World Cup clash against Cameroon on June 13, while Portugal have one more friendly to improve their attack.
|10||G. dos Santos|
|Coach: M. Herrera|
for José Corona 46'
for G. dos Santos 58'
for A. Guardado 78'
for O. Peralta 78'
for H. Herrera 85'
|Mignolet: Liverpool in better position to win title than in 2013-14|
|Giroud wants Premier League title but understands China temptations|
|Tianjin forced to scrap moves for Costa, Benzema, Cavani and Falcao|
|My goal was better than Mkhitaryan´s - Giroud|
|Pochettino not interested in Argentina job|
|Kane: Tottenham can win Premier League|
|Corinthians dreaming of Drogba - Paulo Roberto|
|Coutinho calls for Liverpool focus|
|Chiellini compares Pogba to LeBron and Bolt|
|Maradona to become Napoli ambassador|
|Mihajlovic furious after Torino collapse|
|Icardi has offers from China - Wanda Nara|
|Pogba can cope with pressure - Ibrahimovic|
|´My half-time words will stay in the dressing room´ - Montella annoyed with AC Milan|
|Juventus unveil dramatic change to club logo - but not everyone´s a fan|
|´I do not think I will return to coaching´ - Van Gaal set to call it quits|
|Torino 2 AC Milan 2: Bacca caps thrilling comeback as hosts pay the penalty|
|DR Congo 1 Morocco 0: Kabananga pounces on blunder to give 10 men the points|
|´Happy and comfortable´ Sanchez dismisses Arsenal exit talk|
|How much?! West Ham flop Simone Zaza could cost Valencia €20m|
|Mali v Egypt: Salah leads Pharaohs´ bid for AFCON glory|
|Sevilla concede they ´cannot force´ sporting director Monchi to stay|
|Ivory Coast 0 Togo 0: Reigning champions held to opening draw by Adebayor and co.|
|Goalkeeping woes, Stones and tactical confusion - How Guardiola is making life difficult for himself|
|Ozil and Sanchez can be persuaded to stay - Cech|
|Pogba: I rejected Barcelona and Real Madrid|
|Ghana v Uganda: Gyan dreams of first trophy since 1982|
|Chiellini: Juventus a work in progress|
|Robben agrees Bayern renewal until 2018|
|Hazard: Goals do not matter to me|
|Bennell pleads not guilty to eight child sex offences|
|Muller fed up with debate over Bayern role|
|Wenger glad Sanchez is not ´a Costa problem´|
|Flick resigns as DFB´s sporting director|
|Gomis ´can´t wait´ to welcome Payet to Marseille|
|Chinese FA changes foreign player rules after ´irrational´ spending|
|Like father, like son: Justin Kluivert follows in dad´s footsteps|
|´No reason to lose him´ - Marotta rubbishes talk of Allegri exit|
|Courtois: We don´t need Costa|
|Kane: Tottenham players won´t go to China|
|Noble ´angry and disappointed´ with Payet|
|Klopp furious over Matip uncertainty|
|Wenger surprised by tight Premier League|
|´Money is not everything´ - Conte issues warning amid China speculation|
|Fiorentina defeat a ´bad setback´ - Allegri|
|´This will elevate this group of players´ - Sampaoli revels in Sevilla late show|
|WATCH: Rio Ferdinand screams and dances in crazy Man Utd celebration|
|Real Madrid relaxed, admits Zidane after Sevilla defeat|
|Monaco go top of Ligue 1 with stunning Marseille victory|
|Ronaldo equals LaLiga penalty record as Real Madrid lose|
|Sevilla 2 Real Madrid 1: Stunning late comeback ends unbeaten run at 40|
|Fiorentina 2 Juventus 1: Brilliant Viola breathe life into Serie A title race|
|Tunisia 0 Senegal 2: Mane on target as favourites start strongly|
|Mourinho explains Klopp confrontation|
|Klopp delights in Alexander-Arnold display|
|Algeria must cut out mistakes against Tunisia - Leekens|
|Long balls led to Man Utd equaliser, says Klopp|
|´We attacked, Liverpool defended´ – Mourinho insists a point flattered Klopp´s men|
|DR Congo v Morocco: ´Confidence´ the Atlas Lions´ biggest hindrance ahead of AFCON opener|
|Ibrahimovic: Direct tactics worked for United|
|Guardiola rues gap to Chelsea after Goodison mauling|
|Algeria 2 Zimbabwe 2: Mahrez double prevents shock defeat|
|Manchester United 1 Liverpool 1: In-form Ibrahimovic saves hosts|
|Ivory Coast v Togo: AFCON champions hope to tame Le Roy´s ´troublemakers´|
|Guardiola lays City´s mental frailties bare after Goodison rout|
|Koeman hails ´perfect´ Everton after City mauling|
|Nice stalemate gives Monaco chance to go top|
|Guardiola suffers heaviest league loss in Everton thrashing|
|Neymar-esque Zaha is England´s loss – Bolasie|
|Everton 4 Manchester City 0: Koeman leaves old pal Guardiola´s title bid in tatters|
|Matip withdrawn from Liverpool selection over eligibility questions|
|Podolski staying at Galatasaray, insists sporting director|
|Cavani wants PSG stay|
|Torino move feels normal now – Hart|
|Chinese FA changes rule on CSL foreign players - reports|
|Bayern complete swoop for Hoffenheim duo Sule and Rudy|
|Aubameyang: Dortmund not really like Barca, Madrid or Bayern|
|Pogba can chance a game in one second - Herrera|
|Newcastle Jets 2 Perth Glory 2: Keogh´s eighth of season seals draw|
|Klopp: Liverpool ready for Old Trafford test|
|Herrera taunts Liverpool ahead of Old Trafford showdown|
|I had to be 100 per cent to stay at Boca - Tevez|
|No player is bigger than the club - Carroll takes swipe at want-away Payet|
|Icardi: I can always move to China at end of career|
|Mkhitaryan: Klopp convinced me not to join Liverpool|
|Mourinho: Pogba can score every game|
|Cameroon´s profligacy frustrates Broos|