RIO DE JANEIRO (AP) — Devastated. Unable to sleep. Cursing and crying and blaming herself after falling short of her goal to win a fourth consecutive Olympic gold medal.

Staggered by her first-ever loss at the Summer Games, behind by one set in the bronze medal match and trailing in the second, Kerri Walsh Jennings pulled herself together on the Copacabana sand to become the most-decorated beach volleyball player in the sport's Olympic history.

"It's crazy what 24 hours can do," Walsh Jennings said after she and April Ross beat Brazil's Talita and Larissa 17-21, 21-17, 15-9 on Wednesday night. "This is a highlight of my athletic career, without a doubt."

Walsh Jennings struggled with her passing throughout the medal round, including on Tuesday night when the pair lost to Brazil's second-seeded team. But the three-time champion delivered a pair of blocks for the final two points to clinch the bronze.

After hugging their opponents, Walsh Jennings slapped hands with some courtside volunteers and then found a U.S. cheering section in the corner of the 12,000-seat arena built on the beach that serves as the sport's spiritual home.

Wrapping themselves in an American flag, the partners gave each other another long embrace.

"Devastating is a pretty huge word, but it pretty much captures how I felt last night," Walsh Jennings said. "We came here to be our best, and I was subpar."

The victory left Walsh Jennings with three gold medals and a bronze, breaking a tie with former partner Misty May-Treanor as the most successful player in Olympic beach volleyball history.

"I think she's the best player that we have for beach volleyball for all (time)," Talita said. "If you ask everybody, everybody will say 'Kerri.'"

With the win, the Americans avoided a medal shutout in a sport it invented and — with Brazil — has dominated since beach volleyball was added to the Olympics in 1996.

The United States have won six of a possible 12 gold medals in the sport and 10 overall. Brazil has clinched 13 medals — only two gold, with a chance to add two more in Rio.

But with her perfect Olympic record — Walsh Jennings and May-Treanor only lost one set while sweeping to three gold medals — the loss on Tuesday night left the three-time champion in a funk.

Walsh Jennings and Ross said neither of them slept after losing to Brazil's other team in the semifinal; for Walsh Jennings, it was her first loss in 27 Olympic matches. It got worse as the night went on.

It wasn't until she and Ross arrived at the venue Wednesday and got a pep talk from coach Marcio Sicoli that they were able to refocus on the competition.

"He said, 'This is all about you guys,'" she said, adding that he talked about their children and their families and all the people who have supported them. "He hit the heart. He made it about being your best."

Ross, who earned silver in London, said the bronze medal game is "the hardest match to play in sports."

"One team is going home empty-handed, and the other is going home with an Olympic medal," she said.

Brazil's loss still leaves the home country with two beach volleyball medals on home sand.

Agatha and Barbara lost to Germany in the women's championship in the late match, earning the silver. Alison and Bruno were in the men's gold medal match against Italy on Thursday.