Giovani dos Santos played a part in both of Mexico's goals in their 2-0 victory over Brazil in Dallas. Photo: Reuters

Mexico wrapped up their preparations for the start of World Cup qualification with a morale-boosting 2-0 win over Brazil in Dallas.

On the back of victories over Wales and Bosnia, Mexico struck twice in the first half through Giovani dos Santos and Javier Hernandez to earn the upset victory.

Brazil, who were continuing their preparations as hosts of the 2014 World Cup, began with the combined attacking threat of Neymar, Hulk and Leandro Damiao.

But it was Mexico who struck first midway through the opening period. Dos Santos received the ball in space down the left and chipped the ball toward the middle, presumably looking for Hernandez at the near post, but the ball flew over the striker's head as well as beyond Brazilian keeper Rafael and arrowed perfectly into the top corner.

Dos Santos, rarely given a chance with Tottenham but so often a star for El Tri, was again the man at the center of things as Mexico added a second in the 33rd minute. The versatile forward was caught by a clumsy challenge in the box by Juan that gave the referee no choice but to point to the spot. Chicharito was to man to step up and he side-footed the ball purposefully into the bottom right-hand corner.

Brazil, however, will doubtless have considered themselves unlucky not to have a penalty of their own in the first half. A typically powerful run by Hulk was halted in the box by a challenge from Francisco Rodriguez that left the Chelsea-target seething on the turf.

Still trailing as the hour mark passed, Brazil coach Mano Manezes tried to pave away back into the game by bringing on another reported Chelsea target, livewire Lucas Moura, in place of holding midfielder Sandro.

Mexico almost capitalized on Brazil's increasing offensive outlook, though, as their own substitute Aldo de Nigris placed a difficult volley from an angle just over the far post after a cross from the right by Hernandez.

Mexico would have further chances to extend their lead on the break. Some neat interplay between Hernandez and De Negris got the Manchester United striker behind Brazil's defense, but his left-footed shot was too close to Rafael.

As expected, the Selecao also created opportunities of their own in the closing stages. Center-back Juan forced a fine save from Corona in the 74th minute with a fizzing effort following a freekick from the fright.

But the best chance of the entire match would fall to substitute Alexandre Pato. The forward looked certain to score as the ball was fired low across to him from the left by Hulk, but from six yards out, in the center of goal, the Milan man somehow fluffed his kick.

While there were no further goals, things heated up in the final minutes as a spat between Neymar and Mexican defender Maza threatened to boil over.

A white Fiat van rammed into pedestrians outside enjoying a late afternoon stroll on Las Ramblas in Barcelona on Thursday killing at least 13 people and leaving hundreds injured. The Islamic State group claimed responsibility for the attack.