RIO DE JANEIRO (AP) — Mouth agape, Matt Anderson yelled from every ounce of his being to celebrate big hit after pounding big hit. Erik Shoji chased down ball after ball, diving into the U.S. bench to keep one key point alive.

When the men's volleyball team had no choice but to fight to remain in the tournament a little longer, the Americans delivered against the big beast that is Brazil — a team playing on its home turf.

After two forgettable preliminary matches and facing the real possibility of Olympic elimination, Anderson and the Americans stunned Brazil in four sets Thursday night to deny the previously unbeaten host nation a quarterfinal berth.

Anderson led the charge for a roster packed with Olympic first-timers, but this inspired performance took every player and every play.

"We play our best volleyball when our backs are against the wall," U.S. captain David Lee said. "We proved it again tonight. ... This was probably the hardest we've fought, I think our team has ever fought. That's some of the best defense I've ever seen."

Anderson brought it with his jump serve, his big hitting and reliable passing in a 25-20, 25-23, 20-25, 25-20 victory that left the raucous, flag-waving pro-Brazil crowd at Maracanazinho arena in utter disbelief.

"When you're playing against an entire crowd that's against you, 95 percent of the crowd's against you, if you can get them to be quiet, it's a hell of a feeling," Anderson said.

After being swept by Canada in the opener, the Americans held a player-only meeting, then other sessions with the coaches, even some individual sitdowns — everybody determined to get it right before it was too late.

"We're like a family, so there's nothing that can't be said between each other. We hear the message not the words," Anderson said. "It's a huge lesson in knowing that we can come back, even against one of the best teams, if not the best team in this tournament."

The U.S. snapped a four-match losing streak to Brazil in international competition. When Brazil's kill attempt sailed long on match point, the Americans could truly jump up and down to cheer their first victory at the Rio de Janeiro Games — and one that will be remembered by a captivated U.S. crowd back home that weighed in on social media with shoutouts.

Anderson, who already had scored 20 points early in the fourth set, set the tone from the opening serve of the late-night match beginning at nearly 11 p.m. local time.

The 6-foot-8 outside hitter pumped his tattooed arms and yelled out "Yeah!"

"There's like this look that he gets and some of the celebrations," Shoji said. "I can't really describe it but you just know if you feed him the ball and he gets a kill, he starts rolling."

Shoji saved two balls with lunging, one-handed gets to keep a point alive and put the Americans ahead 6-2 in the fourth — the back-row specialist diving into the U.S. bench and also over the end line during the sequence.

During that back-and-forth first set, balls were coming across the net so hard that one kill slammed into Shoji's chest and sent the U.S. libero to the floor.

Brazil had only dropped two sets over its first two matches.

Earlier Thursday, Argentina and Poland played the longest set so far in the Olympic tournament, with the Poles (3-0) outlasting the Argentines 37-35 in a back-and-forth third set on the way to a sweep and quarterfinal berth.

Italy, playing without injured captain Emanuele Birarelli because of a sprained right ankle, topped Mexico in straight sets, 25-17, 25-13, 25-17.