In a rematch of the 2008 Beijing final, which the Brazilians also won 3-1 for their first gold in the sport, second-ranked Brazil rebounded from a disastrous first set to win 11-25, 25-17, 25-20 25-17.
Destinee Hooker, the second-best scorer in London and the star of the top-ranked U.S. team, was held to 14 points.
Brazil became the third team to repeat as gold medallist . The Soviet Union won in 1968 and 1972, while Cuba won three straight starting with the 1992 Barcelona Games.
Besides its Beijing and London golds, Brazil won back-to-back bronze medals in the 1996 Atlanta and 2000 Sydney Olympics.
Jaqueline Carvalho had 18 points for Brazil, which celebrated the win by doing summersaults across the court while some of the U.S. players sobbed.
The loss denied the favoured United States it's first gold medal.
It was the U.S. team's third appearance in an Olympic final. The United States won the silver medal in the 1984 Los Angeles Games before earning two straight in Beijing and London. The team won bronze in Barcelona in 1992.
The United States and Brazil split their eight previous Olympic matches. The two teams also met in London in the preliminary round, with Hooker's 25 points leading the U.S. team to a 3-1 victory.
With U.S. captain Lindsey Berg starting despite a left Achilles strain earlier in the competition, the United States took an early 11-4 lead on Hooker's ace.
Brazil coach Jose Roberto Guimaraes shouted at his players to calm down during a time-out, but two straight kills from Hooker and Foluke Akinradewo's block made it 19-7. Jordan Larson spiked for set point.
Brazil rebounded to take an 11-6 lead in the second on Fernanda Rodrigues' kill, sparking a thunderous ovation from the fans at Earls Court. Logan Tom's spike evened the match at 12, but Brazil scored the next six straight points capped by Jacqueline Carvalho's kill to make it 18-12.
Fabiana Claudino spiked for set point.
The Brazilians celebrated wildly after taking a 6-2 lead in the third. The United States narrowed it to 21-19 on Hooker's kill, but it was as close as they would come and Castro's kill won the set.
With momentum on its side, Claudino's kill gave Brazil a 13-9 advantage of in the fourth. Thaisa Menezes extended it to 23-14 before Rodrigues' match-winning kill.
Castro and Claudino leapt into the official's chair while Brazil's coaches rushed to the dogpile with the other players.
Brazil unexpectedly struggled in the preliminary round, going 3-2 with losses to the United States and a three-set upset by South Korea. They needed a victory over Serbia in the round's final match to advance.
But the team was inspired in the quarterfinals when they denied Russia match point six times before winning 3-2 to advance to the semifinals for the seventh straight Olympics.
The U.S. women advanced to the gold medal rematch with a straight-set victory over South Korea that was fueled by Berg's emotional return after missing a game with the Achilles injury.
Berg was hurt in the Americans' final preliminary-round match against Turkey last Sunday. The United States was tightlipped about the extent of her injury because that could have given opponents an advantage.
Berg was day-to-day going into the final.