Alvarez put a second-string Argentina ahead in the first half with a shot from the edge of the penalty area.
Messi, Sergio Aguero and Angel Di Maria came on in the second half and combined elegantly to double the lead in the 67th minute.
Diego Costa looked plenty fit for the World Cup, using a burst of speed on his injured hamstring to draw an early penalty and playing into the 74th minute to help Spain beat El Salvador 2-0 outside Washington D.C.
"It was good to get rid of the fear I had," Costa said through an interpreter. "I am not 100 percent, but about the injury, it is clear that I am very well, that I am better. So this week I must work hard."
David Villa scored his 57th and 58th international goals amidst numerous near-misses for the reigning world champs
England and Honduras drew 0-0 in a fiery and physical match that saw Honduras defender Brayan Beckeles sent off in Miami.
The weather was as wild as some of the action on the pitch, with the game halted midway through the first half for 45 minutes for a lightning storm.
England struggled to create scoring chances even with a man advantage, and the pressure will grow for Ross Barkley to start in Brazil after the 20-year-old midfielder raised the tempo when he came on at half time.
Beckeles, who had been booked for a lunge on Danny Welbeck, was shown a second yellow card in the 66th minute after catching Leighton Baines' face with his elbow.
Jozy Altidore ended a six-month scoreless streak with a pair of goals, leading the United States over Nigeria 2-1. Altidore tapped in Fabian Johnson's cross in the 31st minute, stopping a 27-match scoreless streak for club and country with his first goal since Dec. 4 for Sunderland against Chelsea.
He doubled the lead in the 68th minute, running onto Michael Bradley's looping 30-yard pass over the defense, taking a touch with each foot as he cut inside of Nigeria captain Joseph Yobo and beating goalkeeper Vincent Enyeama with a right-footed shot from 12 yards.
Victor Moses earned and converted a penalty late for Nigeria.
Dries Mertens scored one minute from time as Belgium scrapped to a 1-0 victory over Tunisia, but there are injury concerns for star forward Romelu Lukaku, who limped off after being stepped on in stoppage time.
"For now it looks like a severe sprain, but of course there will be further tests tomorrow," Belgium coach Marc Wilmots said. "As it looks now, Romelu will be out for three or four days. Let's hope it stays that way."
The match was interrupted for about 40 minutes after a severe hail storm forced players off the field in the first half.
Cameroon claimed a 1-0 win over Moldova thanks to Edgard Salli's goal in the 30th minute.
Maxi, Alvarez forming solid partnership
Argentina coach Alejandro Sabella praised his midfield partnership of Maxi Rodriguez and Ricardo Alvarez after the Albiceleste's 2-0 win over Slovenia on Saturday.
Del Bosque optimistic about Spain's chances
Spain head coach Vicente del Bosque is confident in his side's chances at the FIFA World Cup following their 2-0 win over El Salvador on Saturday