Sao Paulo, Jun 23 (AFP) Peru goalkeeper Pedro Gallese committed a horrendous error as Brazil ensured top spot in their Copa America group on Saturday with a 5-0 victory in Sao Paulo.

Goals from Casemiro, Roberto Firmino, Everton, Dani Alves and Willian ensured the Selecao would finish top of Group A and will play their quarter-final in Porto Alegre, potentially against out-of-sorts Argentina, their bitter rivals.

"We knew we'd get there sooner or later because we worked very hard," captain Alves told TV Globo.

"It's thanks to wins like this that we're connected with the fans. When we're all together, we feel the positive energy," he added, alluding to the jeers that greeted the team in their first two group matches.

With Peru already 1-0 down, it was Gallese's dreadful error that led to Firmino's goal and swept the mat from under Peru's feet, with the game turning into a rout.

Darwin Machis scored a brace as Venezuela beat Bolivia 3-1 in Belo Horizonte and leapfrogged Peru into second place, securing a quarter-final at Rio de Janeiro's iconic Maracana stadium.

Peru, who finish third on four points, must now wait nervously to see what happens in the other two groups on Sunday and Monday to find out if they will qualify for the knock-out rounds as one of the two best third-place finishers.

Never before since the Copa America adopted a 12-team format in 1993 with eight sides going through to the quarter-finals, has a side mustering four points failed to progress.

Hosts Brazil took an early lead in scrappy fashion when Philippe Coutinho's corner was flicked on at the near post for Marquinhos to head goalwards from inside the six-yard box, with Gallese rooted to his line.

The ball came back off the post, grazed Marquinhos's shoulder and was then headed over the line by Casemiro on 12 minutes.

If Gallese was partly at fault there for not commanding his area, he was totally to blame for Brazil's second.

The goalkeeper dallied over a clearance and when he tried to hoof the ball upfield, it cannoned off a jumping Firmino, looped over his head and again came back off the post.

The ball bounced back to Firmino who waltzed around the stranded Gallese and slotted the ball into the empty net on 19 minutes.

- Willian completes rout -

==========================

Peru had barely been in the game but captain Paolo Guerrero did curl a free-kick over the top.

Yet the match was effectively over as a contest on 32 minutes when Everton cut in off the left flank and fired a snap effort into the bottom corner, with Gallese a touch slow to react and beaten at his near post.

With almost two thirds of the match to go, Peru were relying on a favor from Bolivia to hold onto second place in the group.

Brazil, who were boosted by a visit from the injured and absent Neymar on Friday, did not let up in the second half.

Alves was next in on the scoring act after playing a pair of one-twos with Arthur and Firmino before firing across Gallese on 53 minutes.

Willian sealed the rout in the last minute with a stunning strike from the corner of the 18-yard box.

And there was still time for Gallese to give away and then save a Gabriel Jesus penalty in stoppage time.

In Belo Horizonte, Venezuela were off to a dream start when Machis headed home a cross from Ronald Hernandez in the second minute.

Machis doubled Venezuela's lead on 58 minutes, converting a pass from Tomas Rincon.

But just after Jhon Chancellor missed the chance to extend Venezuela's lead when he hit the bar with a header, Leonel Justiniano pulled back a goal for Bolivia from outside the area.

Venezuela, though, were not to be denied and Josef Martinez flick home a header from Yeferson Soltedo's dinked cross to book their place in the knock-out stages.

"We dedicate this to the whole country, which is always keeping an eye on us," said Martinez. (AFP)

(This is an unedited and auto-generated story from Syndicated News feed, LatestLY Staff may not have modified or edited the content body)