RUSTENBURG, South Africa (AP) -- Outplayed by Italy and Brazil, the U.S. soccer team once again was on the verge of first-round elimination from a big international tournament.
To reach the semifinals of the Confederations Cup, the Americans needed to beat Egypt by at least three goals while the world champion Italians lost to Brazil by at least three.
Astronomical odds, right?
Well, advance they did.
Charlie Davies scored in the 21st minute and Michael Bradley -- the son of U.S. coach Bob Bradley -- connected in the 63rd to get a Father's Day goal for the second straight year. Clint Dempsey then broke a nine-month international scoreless streak in the 71st, giving the United States an improbable 3-0 victory Sunday night.
And in a game played simultaneously, Brazil scored three times in the first half to defeat Italy 3-0.
Now it's on to a semifinal matchup Wednesday with European champion Spain, unbeaten in 35 matches since a November 2006 exhibition loss to Romania. The Spaniards are the world's top-ranked team.
"All of the critics in America who said we were no good after losing to Italy and Brazil, let's see what they say now," Michael Bradley said.
Since advancing to the 2002 World Cup quarterfinals, the U.S. team had been knocked out of the first round of the 2003 Confederations Cup, the 2006 World Cup and the 2007 Copa America.
"The first thing that was required was belief," Landon Donovan said. "I can't imagine many times that something like this has happened. When you think about it, to have advanced out of a group with Brazil, Italy and the African champions is phenomenal."
Getting past Spain may be an even tougher task. The U.S. lost to Spain 1-0 in an exhibition at Santander on June 4 last year.
"We know the way they can move the ball and keep possession," Bob Bradley said. "We played a good first half, but they wore us down in the second half and it didn't feel too good."
Defending tournament champion Brazil (3-0) won Group B with nine points and plays Thursday against host South Africa. While the U.S., Italy and Egypt all finished at 1-2, the Americans scored four goals and allowed six. Italy also had a minus-2 goal difference but scored only three goals and Egypt was minus-3.
"It's like that quote from 'Dumb and Dumber': 'So you're telling me there is a chance.' That's what we kept saying," defender Jonathan Bornstein said.
Bob Bradley made three changes, inserting backup goalkeeper Brad Guzan, midfielder Ricardo Clark and Davies, a forward from Manchester, N.H., who turns 23 on Thursday. While Clark was ejected from the opening 3-1 loss to Italy and Sacha Kljestan from the 3-0 defeat to Brazil, no one was sent off this time.
Outshot a combined 45-19 in the first two matches against teams ranked fourth and fifth, the 14th-ranked U.S. outshot the No. 40 Egyptians 16-13. Egypt was missing injured forwards Amr Zaki and Mohamed Zidan.
Davies scored following a U.S. throw-in. Goalkeeper Essam El Hadary made the save as defender Ahmed Fathi kneed him in the head, and Davies got the rebound and kicked it in off the goalkeeper for his second international goal since his debut against China in June 2007. Davies' previous international goal was in a 2-1 loss at Trinidad in a World Cup qualifier last October.
Egypt caught a break in the 52nd minute, when Jozy Altidore's shot deflected off goalkeeper El Hadary and toward the goal. It bounced off the thigh and arm of defender Hani Said and away from the net, but referee Michael Hester of New Zealand didn't call a hand ball.
Bradley connected from about 12 yards off an exchange of passes with Donovan in the 63rd minute. It was his sixth goal in 33 appearances.
Dempsey scored the goal that put the U.S. over the top eight minutes later, taking a 40-yard cross from Jonathan Spector, outjumping defender Wael Gomaa and beating El Hadary with a diving header from about 7 yards. It ended a career-worst eight-game goalless streak for Dempsey with the national team, the longest of his international career. Dempsey, who has 14 international goals, had not scored for the U.S. since Sept. 10 against Trinidad and Tobago.
Gomaa had a chance to score in the 90th minute -- and put Egypt in the semis -- but his header went over the crossbar.
"It wasn't until I saw everybody else celebrating that I knew we advanced," Dempsey said. "It's a weight off of our shoulders. Everybody else was against us, but we believed it ourselves. No one thought that we could go to the next round, but we showed what you can accomplish by fighting hard and sticking together."