SALVADOR, Brazil – Louis van Gaal, one of the game’s greatest coaches, was criticized before the World Cup for being too defensive for a nation that loves attacking play.

His decision to field five defenders against Spain though, proved a masterstroke. His Netherlands team thrashed the defending world champions 5-1 Friday with a clinical display of counterattacking soccer that had Spain chasing shadows at the end as Dutch fans roared “Ole!” each time their team passed the ball.

“If you see how he prepared us, and how he predicted the game would go, and you see how it went — unbelievable,” said Robin van Persie, whose stunning header to equalize shortly before halftime turned the tide of the match. “It went exactly as the entire technical staff predicted.”

It was Spain’s worst defeat in the tournament since a 6-1 setback to Brazil in 1950.

Save 75% on a Digital Subscription Today

The Dutch performance shocked even casual fans on the second day of the World Cup, showing why Manchester United of the English Premier League was so keen to sign van Gaal to rebuild the storied team. He starts work at Old Trafford when the Netherlands leaves Brazil. If the team keeps playing this way, he could keep Manchester fans waiting until mid-July.

The 62-year-old Dutchman has a history of getting the best out of teams and blending youth with experience, taking Ajax to the UEFA Champions League title in 1995.

He is bidding to make the Netherlands world champions for the first time after losing three finals — including four years ago when Andres Iniesta’s extra-time goal won it for Spain.

It wasn’t shocking for the Dutch to get revenge for that loss, but the way they demolished Spain — the dominant world soccer power since 2008 — sent a signal that the run of this generation of Spanish stars might be coming to an end.

Spain, which won the last two European Championships and the 2010 World Cup, will probably have to beat Chile and Australia to qualify for the next round, where a likely date with host Brazil awaits.

“They were better than us in the second half, you have to recognize that,” Spain coach Vicente del Bosque said. “It’s a delicate moment for us. We need to find solutions now.”

Spain showed flashes of its slick-passing, ball-control, “tiki-taka” style, but never recovered from van Persie’s masterful goal.

“The equalizer was very crucial at that point,” Netherlands midfielder Jonathan de Guzman said. “I think we took advantage of that.”

In the second half, Spain’s usually solid defense collapsed in the face of wave after wave of Dutch attacks, many starting off long passes from defenders.

Veteran goalkeeper Iker Casillas shouldered the blame.

“It wasn’t one of my best games, I wasn’t at the level I needed to be,” he said. “I have to accept all criticism.”

Van Gaal always insisted his five-man defense wasn’t as negative as it sounded, and he was proved right.

Left back Daley Blind surged forward to provide two pinpoint accurate passes for assists — van Persie’s header and Arjen Robben’s first goal.

Even van Gaal was stunned by the margin of victory.

“To be quite honest, we did not expect it,” he said. “This has got to do with strategy and the dedication of the players to execute with conviction.”

Fitness also appeared to play a role in Spain’s second-half collapse. While the veteran Spanish players tired, the Dutch still looked fresh despite the humidity.

Van Persie’s header is an early contender for goal of the tournament. He dived full-length and sent a looping header over the stranded Casillas.