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'
|M´Vila keen to stay if Sunderland survive|
|Johnson admits child sex and grooming charges|
|Amazing Mahrez is one of Premier League´s best - Ulloa|
|Ronaldo, Messi rivalry good for football - Zidane|
|Barros Schelotto leaves Palermo|
|Age is just a number - Ilori defends Klopp´s team selection|
|Messi, Suarez and Neymar rested for Copa second leg|
|Madrid can dream of trophies under Zidane - Raul|
|Ancelotti: Italy job is a decade away|
|Reus will become a monster, says Dortmund boss Tuchel|
|Young Tottenham stars don´t know their limits - Lloris|
|Niang happy at Milan despite Leicester interest|
|Ticket price rise means more tourist fans, warns football supporters chairman|
|Ogbonna revels in first West Ham goal|
|Copa Libertadores Review: Huracan, River Plate advance to group stages|
|Klopp backs Benteke to rediscover goalscoring form|
|Turan will not leave Barca for China - agent|
|Beating Chelsea more difficult without Mourinho - Motta|
|Tuchel praises Dortmund for ´perfect game´|
|Klopp rues Liverpool wastefulness in FA Cup loss|
|Allegri: Chelsea rumours unfounded|
|Bilic feels weight of history after Liverpool win|
|Coupe de France Review: Second tier Sochaux stun Ligue 1 Monaco|
|West Ham 2 Liverpool 1 (aet): Ogbonna sinks Klopp´s men in cup thriller|
|Football League Review: Rhodes rescues a point to send Boro top|
|Stuttgart 1 Borussia Dortmund 3: Aubameyang helps Tuchel´s men into last four|
|Kyle Allen blames chaotic Texas A&M culture on Johnny Manziel era|
|Dortmund fans stage protest against ticket prices for Stuttgart game|
|Bayer Leverkusen 1 Werder Bremen 3: 10-man hosts dumped out|
|Ferdinand fears title wilderness for United|
|Carvalho lands new Sporting deal with €45m buy-out clause|
|Ben Arfa out for at least four weeks with hamstring injury|
|Neville´s Valencia woes welcomed by Crespo|
|Ozil key to Arsenal´s title hopes - Rosicky|
|Zika threat could keep Solo from Rio Olympics|
|Blanc pleased to have solved David Luiz matter|
|Atletico midfielder Partey suffers thigh strain|
|Dickov: Leicester title run built to last|
|Guardiola not a menace for our players, says Luis Enrique|
|Mexico v Senegal: Osorio believes in youngsters|
|Celta Vigo v Sevilla: Krohn-Dehli not taking Copa del Rey final for granted|
|Madrid confirm Marcelo shoulder dislocation|
|Injury rules Chiellini out of crucial Juve games|
|Oblak extends Atletico deal|
|Blanc hints PSG could move for Ben Arfa|
|Luis Enrique urges Neymar to cope with off-field distractions|
|Carrick: Manchester United not throwing in towel|
|Neville determined to turn things around at Valencia|
|Guardiola hails Lewandowski professionalism amid Real Madrid and PSG rumours|
|Guardiola wary of ´aggressive´ Bochum|
|Premier League reveals new logo|
|West Ham open Payet contract talks|
|I could leave Barcelona for Guardiola, says Busquets|
|Giggs can be Manchester United´s Guardiola - Robson|
|Zidane has everything to become a great coach - Ancelotti|
|Carragher: Liverpool got it wrong on ticket prices|
|Neymar will be at Barcelona for years, claims director|
|Eder talks up Inter´s Scudetto chances|
|Larsson: Watching Barca is like playing FIFA|
|City recruit Wilkinson hoping to debut in Melbourne derby|
|Allegri will join Chelsea, says former coach|
|Zanetti: No need to compare Maradona and Messi|
|Vardy: I never expected Leicester to top Premier League|
|Capello: Ronaldo has at least three years at the top|
|Klopp hoping for Sturridge revival|
|Bilic wants new contract to keep Payet at West Ham|
|Shelvey can be as good as Cabaye - Sissoko|
|Rooney leaps to Depay defence after Chelsea error|
|Januzaj, Varela injured in United Under-21s win|
|Valencia v Barcelona: Luis Enrique eyes record as Neville stands on the brink|
|Espanyol 0 Real Sociedad 5: Vela scores stunner in ruthless display|
|Cruyff would have preferred Guardiola at Manchester United|
|Questioning Ronaldo is an insult - Aduriz|
|Peterborough United v West Brom: Berahino set for another chance|
|Barcelona confirm medical tests for Messi|
|Ajax defender Riedewald out for season with broken ankle|
|Barcelona is the best place for Neymar - Mascherano|
|Clement axed as Derby head coach|
|Chelsea defender Zouma out for the season|
|Rodgers: I´ve turned down Swansea and four other clubs since Liverpool|
|Russia to invite Blatter and Platini to World Cup 2018|
|Robben rejoices as Ribery resumes Bayern training|
|Terry as good as ever, says Azpilicueta|
|Struggling Rotherham sack Redfearn|
|Courtois feels Champions League or FA Cup glory would save Chelsea´s season|
|Paris Saint-Germain v Lyon: Genesio vows ´unlucky´ visitors will have a go|
|Liverpool cancel Q&A to discuss ticket price furore|
|Klopp: Liverpool won´t follow Payet to the toilet|
|Bochum v Bayern Munich: Alonso braced for intense month|
|Ronaldo: Two more years at Real Madrid and then we´ll see|
|No problems with Kagawa says Dortmund boss Tuchel|
|Laporte denies saying he would reject Barcelona|
|Impressive Sturridge and returning Coutinho in contention - Klopp|
|Leicester were afraid of Italian tactics - Ranieri reveals his secret|
|Coentrao sustains fractured foot|
|Barcelona director at ease over Neymar future|
|Mata touched by reaction of Chelsea fans|
|Alonso: Guardiola departure not a distraction|
|Thiago Silva: PSG can stay unbeaten all season|
|Cristiano Ronaldo will keep breaking records - Hugo Sanchez|
|Bilic: Klopp will be back because he is a leader|
|Mancini dismisses Inter title bid as ´a closed story´|
|Guardiola took Bayern for a ride - Hamann|
|Mihajlovic demands more from Balotelli|
|Campbell urges clubs to give black managers a chance|
|Marchisio expects Napoli showdown to be decisive|
|You can´t expect to score lots of goals in every game - Modric|
|FFA hit Wanderers with show cause notice|
|We did not deserve Madrid defeat - Granada coach|
|Mata frustrated with Chelsea draw|
|Valencia won´t sack Neville - Mendieta|
|Senna makes Villarreal return|
|Spalletti: Roma need to cut out lapses|
|China will break $100m transfer fee - Cahill|
|Ranieri: Don´t look down|
|Guardiola reinvented football - Alaba|
|Tottenham fear no one - Kane|
|Flores believes Tottenham are Premier League´s best|
|Henderson: Walkout no excuse for Sunderland collapse|
|Neville bullish about Valencia future|
|Ramos: Modric key for Madrid|
|La Liga Review: Luis Enrique matches Guardiola record, Modric rescues Madrid|