By Anthony Boadle

RIO DE JANEIRO (Reuters) - Brazil's men's volleyball team defeated Italy on Sunday to win their third gold medal in the sport and cap their country's best Olympic performance with a total of seven golds in the Rio Games.

The Brazilians had lost to the Italians in a pool match but won the final in straight sets 25-22 28-26 26-24, handing Italy its third silver medal in men's volleyball.

Brazil struggled in the pool stage, losing two matches, to the U.S. and Italy, and only making it into the knockout rounds after a tense victory over France in the last game.

But having emerged from the pool, Brazil began to show its class and fueled by raucous home support dropped just one set between the quarter-finals and clinching gold.

The Brazilian victory was largely due to a barrage of winning spikes, serves and blocks by its outstanding outside hitter Wallace de Souza, who scored 20 of Brazil's points.

"The Brazilian team played very well and definitively deserved to win. My team gave it all they had, but Brazil was superior and dominated," said Italian coach Gianlorenzo Blengini.

Brazilian fans that packed Rio's Maracanazinho stadium erupted with joy, chanting "The champ is back." Cheering was heard in neighborhood streets across Rio.

In the audience to witness the win was Brazilian soccer star Neymar, fresh from Saturday's gold-winning final against Germany.

Brazil last won volleyball men's gold in 2004 when it beat Italy in Athens, and took its first at Barcelona in 1992.

Earlier on Sunday, the United States men's volleyball team recovered to defeat defending Olympic champions Russia in a five-set battle for the bronze medal.

The U.S. lost the first two sets but came back to win 23-25 21-25 25-19 25-19 15-13, with an ace in the tie-breaker by top scorer Matt Anderson helping to seal the victory.

The Americans, a young team with eight players who had never competed in the Olympics, came to Rio seeking a fourth U.S. gold medal in the sport and were favorites after winning the World Cup last year.

They lost their first two matches against Canada and Italy, who beat them again in the semi-finals.

The U.S. women's volleyball team also went home with bronze after failing to win an elusive first gold for their country.

(Additional reporting by Stepehn Eisenhammer; Editing by Ken Ferris and Meredith Mazzilli)