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'
|Schwarzer has shown age is just a number - Kisnorbo|
|Mangala: City want to make history in Champions League|
|Lineker struggling to believe Leicester success|
|Carrick: Top four not gone yet|
|De Gea named United´s player of the year|
|Dundee 2 Dundee United 1: Visitors relegated|
|King delighted to crown Leicester rise with title|
|Ranieri: I knew I would win a title eventually!|
|Soccer world reacts to Leicester´s remarkable Premier League title|
|Serie A Review: Strootman starts as Roma fight back again|
|Leicester success a ´good omen´ for Selby|
|Kane: Chelsea celebrated like they won title|
|Thumping Man City, edging Tottenham and five matches that won Leicester the Premier League|
|Vardy marvels at Leicester´s finest hour|
|Ranieri called me to say thanks, reveals Hiddink|
|Leicester did the impossible - Morgan|
|Terry: Leicester title triumph gives hope to smaller sides|
|Pochettino proud as Spurs fall short|
|Savage: Leicester title a key moment in Premier League history|
|Football world reacts to Leicester´s remarkable Premier League title|
|Leicester deserve Premier League title - Hazard|
|Leicester players celebrate Premier League title triumph in style|
|From Tinkerman to champion: Ranieri writes the greatest story ever told|
|Champions Leicester worthy of a film - Heskey|
|The greatest upset: Champions Leicester break new ground for sporting underdogs|
|Chelsea 2 Tottenham 2: Leicester champions as Spurs collapse at Stamford Bridge|
|Leicester crowned Premier League champions|
|Werder Bremen 6 Stuttgart 2: Crushing win lights up survival fight|
|Malaga 3 Levante 1: Late collapse all but relegates Rubi´s men|
|Neuer cites home crowd as advantage for Atleti clash|
|Icardi surprised by Argentina selection|
|Ribery fit to face Atletico in Champions League semi-final|
|FIFA extends Sakho ban worldwide|
|Torres and Atletico ready for war at Bayern|
|Football League Review: Burnley earn promotion back to the Premier League|
|Simeone pledges to chase victory at Allianz Arena|
|´Nothing in life is certain´ - Handanovic on Inter future|
|CAS order FIFA to reconsider Gibraltar membership|
|Trapattoni: I love Simeone and Atletico´s style|
|Balotelli is a changed man, says Galliani|
|Real Madrid job is about politics - Pellegrini|
|De Laurentiis wants Sarri at Napoli long term|
|Yarmolenko will not go to Everton or Stoke - Dynamo president|
|Suarez a difference maker - Stoichkov|
|Drinkwater to face no further action from FA|
|Albrighton: Leicester players will watch Chelsea v Tottenham together|
|More to Manchester City than Aguero - Casemiro|
|Boban: Maldini can save Milan|
|Real Madrid v Manchester City: Pellegrini eyes away goal as Zidane hopes for Ronaldo|
|Pellegrini doubts longevity of Leicester´s credentials|
|Portugal unconcerned by Ronaldo fitness|
|Ribery tells Guardiola to play him against Atletico|
|Vardy wins FWA Player of the Year award|
|Hiddink: Title pressure could get to Tottenham|
|Messi never cheats, insists Xavi|
|Dortmund tell Bayern Hummels fee is non-negotiable|
|Welbeck a different animal again - Wenger|
|Xavi: Real Madrid played like a small team in Clasico|
|Bayern can win Champions League - Santa Cruz|
|Reina backs Atletico to win the double|
|Perth Glory lure Herd to A-League|
|England can´t afford Australia loss - Kewell|
|Stankovic: Simeone will coach Inter, but not now|
|I had to rotate squad - Pellegrini|
|Candreva backs Inzaghi for Lazio job|
|I can make fans forget my bad season – Hazard|
|MLS Review: Cole sees red in Galaxy stalemate, Valeri stunner lifts Timbers|
|Pochettino: Deal announcement can convince Tottenham stars to stay|
|Hiddink: Chelsea can´t replace Terry|
|Pulisic, Morris picked by Klinsmann in initial Copa squad|
|Wenger anticipated worse from protests|
|Kante set to have stand named after him|
|Furious Mancini slams Inter´s ´worst ever´ first half against Lazio|
|Serie A Review: Champions League places locked, Milan play out six-goal thriller|
|La Liga Review: Villarreal secure Champions League return|
|Lazio 2 Inter 0: Champions League race comes to a Klose|
|Koeman delivers Pelle warning|
|Morata wants to stay at Juventus, claims Marotta|
|Pellegrini disappointed with City defending in defeat|
|Iheanacho: City will bounce back from Saints defeat|
|´On fire´ Mane salutes Southampton show|
|Angers 0 Marseille 1: Batshuayi strike secures Ligue 1 status|
|Southampton 4 Manchester City 2: Mane hat-trick blows top-four race open|
|Van Gaal calls for video referees after Drinkwater decision|
|Schmeichel: I don´t care how we win it|
|Montella open to Italy role|
|Brocchi pleased with Milan fightback|
|Van Gaal defends ´human´ Fellaini over Huth elbow clash|
|Ronaldo wants Zidane to stay at Madrid|
|Ranieri to miss decisive Tottenham clash|
|Rooney disappointed after Leicester draw dents top-four hopes|
|Bayern Munich v Atletico Madrid: Hosts seek to vent Bundesliga frustration|
|Leicester captain Morgan hails battling Old Trafford point|
|AC Milan 3-3 Frosinone: Menez penalty denies strugglers|
|Klopp not concerned by Sturridge behaviour|
|Manchester United 1 Leicester City 1: Captain Morgan on target as Foxes edge closer to glory|
|Allofs: We do not have the same weapons as Bayern|
|Guidolin coy on Swansea future|
|Allegri happy with win after title celebrations|
|Umtiti flattered by Tottenham interest|
|Klopp frustrated by lacklustre Liverpool|
|Hannover mourn Feierabend|
|Godin, Carrasco fit for Bayern clash|
|Swansea City 3 Liverpool 1: Ayew double punishes wasteful visitors|
|Dybala claims Messi, Ronaldo would score less in Italy|
|Juventus 2 Carpi 0: Hernanes, Zaza on target as champions march on|
|Ronaldo back in training for Madrid|
|Barcelona confirm Bravo calf injury|
|Aulas brands Ligue 1 ´championship of Qatar´|
|Leicester City at Manchester United: Aiming for Hollywood ending to title push|
|I can start for England at Euro 2016 - Sturridge|
|Dybala never doubted Juventus|
|Aguero celebrates brother´s Independiente debut|
|Sturridge rounds on critics, plays down Klopp rift|
|Adelaide United 3 Western Sydney Wanderers 1: Reds seal maiden A-League title|
|Eriksson: Simeone is an example to follow|
|´Where am I?´ - Lovren reveals travel struggles|
|´If I have to leave Bayern, then I will´ - Benatia|
|Walker ´over the moon´ after Pochettino agrees new deal|
|MLS Review: Villa leads City, Impact held|
|We´d probably be relegated without Defoe – Allardyce|
|Koeman: Leicester will do well in Champions League|
|Ronaldo needs rest or could miss Euros - doctor|
|United shaped me as a player - Schlupp|
|Sanchez, Vidal lead Chile´s Copa squad|
|Arsenal´s patience paid off - Cech|
|I will know Madrid´s plans - Pellegrini|
|Granada 3 Las Palmas 2: Superb comeback boosts hosts´ survival hopes|
|Martinez pleased with impact of new faces|
|Ligue 1 Review: Lyon, Monaco continue fight for second|
|Serie A Review: Fiorentina frustrated, Torino hit five|
|Barca keeper Bravo set for tests on calf strain|