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 J. Corona 46'
for G. dos Santos 58'
for A. Guardado 78'
for O. Peralta 78'
for H. Herrera 85'
|Maritimo 1 Nacional 1: Tiquinho ensures derby finishes all square|
|Fiorentina 0 Verona 1: Diamanti and Neto pay the penalty|
|Elche 1 Real Sociedad 0: Bergara gifts win to hosts|
|Van Persie returns in Under-21 game|
|Turkish Super Lig Review: Galatasaray slip sees Fenerbahce go top|
|Russian Premier League Review: Arsenal Tula and Rostov maintain survival bids|
|Frontzeck named as Korkut´s replacement at Hannover|
|Lopetegui wary of Bayern backlash|
|Pastore plays down Cantona´s world best tag|
|PSG absences no excuse for failure - Blanc|
|Suarez sad to see Gerrard leaving Liverpool|
|Cleber injury adds to Hamburg woes|
|Northern Ireland free to play Romania at Windsor Park|
|Juve sweating on Vidal availability|
|Monaco v Juventus: Evra ready to take control|
|Striking concerns for Chelsea after Drogba injury|
|PSG and Chelsea have bid for Dybala, claims agent|
|Pogba can leave Juve for ´right offer´|
|Bendtner dropped after arriving late for training|
|Messi achievement unrepeatable, says Luis Enrique|
|Football League Preview: Preston and MK Dons battling to join Bristol City|
|Real Madrid v Atletico Madrid: Ancelotti optimistic amid injury concerns|
|Iniesta declared fit for PSG second leg|
|Bale remains a doubt for Atletico clash|
|Schweinsteiger set to face Porto, Ribery to miss out|
|No broken cheekbone for Silva|
|Final appearance can remove negativity at Villa - Fox|
|Bale selected in Football League Team of the Decade|
|PSV director: United and PSG want Depay|
|Korkut sacked by relegation-threatened Hannover|
|Sherwood: Pressure all on Arsenal|
|Newcastle in a ´dangerous moment´ - Colback|
|Kovac hopes to have Modric fit for Euro qualifier|
|Copa Libertadores Preview: Cruzeiro boss Oliveira does not fear sack|
|MLS Review: Revs extend unbeaten run, Timbers stun City|
|Fournier proud and disappointed|
|Shaw ready to make an impact|
|Hazard among best three in the world - Mourinho|
|Carver: Newcastle are in relegation battle|
|CAF Champions League Review: Setif get two away goals, Al Ahly denied late on|
|Inzaghi praises Milan derby officials|
|La Liga Review: Granada frustrate Sevilla, Villarreal´s woes continue|
|Inter should have had a penalty, Mancini fumes|
|Ligue 1 Review: Lyon return top after derby draw|
|Inter 0 Milan 0: Disappointing derby ends in stalemate|
|Primeira Liga Review: Sporting made to battle, Penafiel running out of time|
|Balotelli targets officials in latest social media outburst|
|Bundesliga Review: Werder Bremen edge Nordderby, De Bruyne rescues Wolfsburg|
|Serie A Review: Napoli close on stumbling Roma|
|Pochettino congratulates 30-goal Kane|
|Rodgers questions Liverpool´s mental strength|
|Carver counting on experience after latest defeat|
|Sherwood marvels at Grealish potential|
|Eredivisie Review: Dordrecht relegated as Go Ahead Eagles stun Feyenoord|
|Newcastle United 1 Tottenham 3: Losing streak continues amid fan boycott|
|Kouyate elbow on Silva accidental - Allardyce|
|Aston Villa 2 Liverpool 1: Delph ends Gerrard´s hopes of dream farewell|
|Pellegrini hails City response to derby defeat|
|Silva back home after Kouyate elbow|
|Manchester City 2 West Ham 0: Silva injury sours routine win|
|Bayern Munich v Porto: Neuer rallies Germans for uphill battle|
|Barcelona v Paris Saint-Germain: Marquinhos keeps the faith ahead of Camp Nou test|
|Fer closes in on QPR return|
|Crouch set for surgery|
|Dortmund confirm Tuchel as Klopp replacement|
|Adams leaves relegation-threatened Tranmere|
|Real still unsure over Modric injury|
|Tevez rubbishes Juve exit talk|
|Moyes: I had to fight to keep Rooney at United|
|Perth Glory 3 Melbourne City 1: Maclaren treble the difference|
|Dyche: Burnley are too honest|
|Illarramendi eager for Real stay|
|Hazard issues Chelsea warning|
|MLS Review: Injury-time winner buoys Galaxy, Martins shows class for Sounders|
|Pastore talents ´unpredictable´ - Blanc|
|Liverpool much bigger than City - Rodgers|
|AFC Champions League Preview: Evergrande look to progress|
|Clarke expects distraught Federici to bounce back|
|Toure is City´s scapegoat - agent|
|Allegri praises high-flying Juve|
|Athletic Bilbao 4 Getafe 0: Hosts end winless run|