Messi spot-kick sinks Portugal
The pair have been on fire in Spain's La Liga, topping the scoring table with 24 goals each, and their first encounter on the international stage lived up to its billing as an entertaining affair, with both leading their sides forward.
Argentina were without Carlos Tevez, and national football association president Julio Grondona said the Manchester City striker was missing because of an attitude problem.
"I think Tevez's absence is because of an attitude he had when he didn't come to play (against Brazil in November) and then did so for his club. The coaching staff didn't like that attitude," Grondona told Argentina's Radio Pop before the game.
Coach Sergio Batista, when he named his squad on January 25, had said he was resting several players including Tevez in order to look at other options.
Messi produced a trademark run on 14 minutes, bringing the ball in from the right wing and beating Raul Meireles to feed Di Maria in the box for the winger to open the scoring with a diagonal shot.
Portugal responded well and levelled seven minutes later when striker Hugo Almeida headed on Joao Pereira's cross and Ronaldo reacted more sharply than keeper Sergio Romero to toe-poke in the equaliser.
"They are two great players, Ronaldo has been playing very well for some time now and Messi is, in my opinion, the best in the world," Argentina's Javier Zanetti, who earned a record 139th cap, told Argentine television.
Argentina host the Copa America in July and Batista, who took over from Diego Maradona after the World Cup, used the friendly to test new players ahead of the tournament.
"It was a useful (match) to prepare for the Copa America, and it helps to win," Zanetti added.
Both sides came close in the second half, with Portugal's Almeida wasting three fine chances and Marcos Rojo and Javier Pastore threatening for the Argentines before Messi converted a late penalty after Coentrao fouled Juan Manuel Martinez.
Ronaldo, who was a constant menace throughout his 60 minutes on the pitch, almost grabbed a second moments after scoring, leading a counter-attack and shrugging off Javier Mascherano to fire a low shot that missed the target after a deflection.
Argentina composed themselves and came close to taking the lead again in the 39th minute when left back Marcos Rojo pushed forward to produce a fine cross which Ezequiel Lavezzi wasted by sending his half-volley over Eduardo's bar.
Portugal's strong spell after half time should have put them ahead but Almeida sent one header over, another against the bar and then somehow sent an easy tap-in wide.
"This is a result we have to accept even though it hurts to lose late in the match and with a penalty. But Portugal was not inferior to Argentina throughout the game and a draw would have been a fitting result," Portugal coach Paulo Bento said.
The defeat is Portugal's first since the coach took over from the sacked Carlos Queiroz in September.