Kyle Beckerman, left, and Timmy Chandler confront Memphis Depay at Amsterdam Arena. (Koen van Weel/ANP)

In a wide-open friendly that produced a barrage of chances, poor defending and a stunning finish, the U.S. men’s national soccer team scored twice in the closing moments to shock the sixth-ranked Netherlands, 4-3, on Friday at Amsterdam Arena.

Danny Williams scored the equalizer in the 88th minute and Bobby Wood broke the deadlock in the 90th as the Americans overcame a 3-1 deficit in the last 20-plus minutes to produce one of the greatest away victories in the program’s recent history. It also marked the first time the United States has defeated the Netherlands in five meetings (1-4-0).

Dutch striker Klaas-Jan Huntelaar scored twice and was credited with the assist on Memphis Depay’s accidental deflection. Gyassi Zardes, a 23-year-old forward for the Los Angeles Galaxy, and John Brooks also scored for the Americans, who will face World Cup champion Germany on Wednesday in Cologne.

The Americans were confident and assertive as the match unfolded, holding possession and creating regular opportunities. Jasper Cillessen thwarted Zardes’ clear bid from 12 yards. Michael Bradley smacked the right post from the top of the box. And Brek Shea picked the right angle to infiltrate the penalty area but did not fool Cillessen with his low effort.

The missed opportunities bit the Americans in the 27th minute when Depay swung in a left-side cross toward Huntelaar, who slipped into a pocket behind Brooks and in front of Ventura Alvarado for a six-yard header past Brad Guzan.

The Americans, ranked No. 27, answered in the 33rd minute when Zardes used the outside of his inside foot to one-time Fabian Johnson’s cross into the near corner for his first career goal in seven appearances.

Halftime could not arrive soon enough, though, as the 2014 World Cup semifinalists were reliably dangerous and applied heavy pressure. An apparent goal in the closing moments was nullified by a foul call in the box.

The Dutch picked up where they left off at the start of the second half. A moment after Guzan stopped Robin van Persie’s close-in header, Huntelaar gained inside position on substitute Michael Orozco and headed Gregory van der Wiel’s cross over the beleaguered goalkeeper.

The madness continued in the 53rd minute when Huntelaar’s drive from the top of the box clipped Depay, caromed off the right post and behind Guzan.

The wide-open play resumed. Zardes’s low threat in the 64th was kicked aside by Cillessen. Brooks cut the deficit to 3-2 after surging out of the back and connecting with Bradley, whose diagonal ball led DeAndre Yedlin into the right side of the box. Yedlin crossed to the unmarked Brooks for his first goal since scoring the game-winner against Ghana in the World Cup opener last summer.

Moments later, Cillessen denied Wood’s bid for the equalizer. In the 83rd minute, Johnson narrowly avoided an own goal when his clearance of a Dutch threat nicked the post.

The chances continued to flow. Cillessen blocked Jordan Morris’s near-post effort, but later, Williams’s 20-yard bid off a clearance deflected off Luuk De Jong and sailed into the right side of the net for his first international goal.

At the other end, Guzan made a sensational save on De Jong, who sent the rebound off the post.

Then in the 90th, Bradley’s work supplied Morris, whose right-side cross found Wood, 22, alone at the six-yard box for an improbable winning goal, his first strike in a U.S. uniform.

“It was an unbelievable game,” Williams said. “It’s a fantastic feeling to win against Holland in Amsterdam.”

Next: Germany on Wednesday in Cologne, 2:45 p.m. ET (Fox Sports 1, UniMas).

SCORING

NED: Huntelaar (Depay), 27th minute.

USA: Zardes (Johnson), 33rd minute.

NED: Huntelaar (van der Wiel), 49th minute.

NED: Depay (Huntelaar), 53rd minute.

USA: Brooks (Yedlin), 70th minute.

USA: Williams, 88th.

USA: Wood (Morris), 90th.

USA LINEUP

GK: Brad Guzan (Aston Villa).

Ds: Timmy Chandler (Eintracht Frankfurt), Ventura Alvarado (Club America), John Brooks (Hertha Berlin), Brek Shea (Orlando City).

MFs: Kyle Beckerman (Real Salt Lake), Michael Bradley (Toronto FC), Alfredo Morales (Ingolstadt).

F: Gyassi Zardes (Los Angeles Galaxy), Aron Johannsson (AZ Alkmaar), Fabian Johnson (Moenchengladbach).

Subs: Michael Orozco (Puebla) for Alvarado in 46th, Mix Diskerud (New York City FC) for Morales in 56th, DeAndre Yedlin (Tottenham Hotspur) for Shea in 57th, Danny Williams (Reading) for Beckerman in 63rd, Bobby Wood (Erzgebirge Aue) for Johannsson in 65th, Jordan Morris (Stanford University) for Zardes in 80th.

Unused subs: GK Nick Rimando (Real Salt Lake), D Brad Evans (Seattle Sounders), F Juan Agudelo (New England Revolution), F Miguel Ibarra (Minnesota United).

Not in uniform: GK William Yarbrough (Leon).

NETHERLANDS LINEUP

GK: Jasper Cillessen (Ajax).

Ds: Daryl Janmaat (Newcastle), Jeffrey Bruma (PSV Eindhoven), Bruno Martins Indi (Porto), Daley Blind (Manchester United).

MFs: Georginio Wijnaldum (PSV Eindhoven), Jordi Clasi (Feyenoord), Robin van Persie (Manchester United), Quincy Promes (Spartak Moscow), Memphis Depay (PSV Eindhoven).

F: Klaas-Jan Huntelaar (Schalke).

Subs: Gregory van der Wiel (Paris Saint-Germain) for Janmaat in 46th, Luciano Narsingh (PSV Eindhoven) for Bruma in 46th, Davy Proepper (Vitesse) for van Persie in 57th, Wesley Sneijder (Galatasaray) for Clase in 78th, Luuk de Jong (PSV Eindhoven) for Huntelaar in 78th.

Gyassi’s goal:

Brooks’s goal:

Williams’s goal:

Wood’s goal: