In January 2005, it was announced that Van Gaal would replace Co Adriaanse as AZ manager on 1 July 2005.
Under Van Gaal, AZ finished second in the Eredivisie in 2005–06 and third in 2006–07.
Van Gaal also led AZ to a runners-up finish in the 2006–07 KNVB Cup and lost a 2007–08 Champions League qualification play-off to Ajax 4–2 on aggregate.

Van Gaal initially announced he would leave AZ at the end of the 2007–08 season due to disappointing results, with the club finishing 11th in the Eredivisie.
When several players of the AZ squad pointed out that they would like him to stay with AZ, however, he said he would give the players a chance to prove themselves.

AZ started the 2008–09 season with two losses: 2–1 to NAC Breda and 0–3 to ADO Den Haag, but after that the Alkmaar-based club remained unbeaten until 18 April, topping the table ahead of Twente and Ajax for the entire season, despite being predicted to finish as low as 13th by pundits.
AZ had the best defensive record in the Eredivisie and the second-best goalscoring record, behind Ajax, thanks to its offensive duo of league topscorer Mounir El Hamdaoui and Brazilian Ari.
They were crowned league champions on 19 April, one day after AZ suffered an unexpected loss at home to Vitesse, which ended a string of 28 unbeaten games (surpassing the team's 1980–81 record of 25 unbeaten games).
That same day Ajax, the only opponent still in theory able to surpass AZ, lost 6–2 to PSV.
In January 2005, it was announced that Van Gaal would replace Co Adriaanse as AZ manager on 1 July 2005. Under Van Gaal, AZ finished second in the Eredivisie in 2005–06 and third in 2006–07. Van Gaal also led AZ to a runners-up finish in the 2006–07 KNVB Cup and lost a 2007–08 Champions League qualification play-off to Ajax 4–2 on aggregate.
Van Gaal initially announced he would leave AZ at the end of the 2007–08 season due to disappointing results, with the club finishing 11th in the Eredivisie. When several players of the AZ squad pointed out that they would like him to stay with AZ, however, he said he would give the players a chance to prove themselves.
AZ started the 2008–09 season with two losses: 2–1 to NAC Breda and 0–3 to ADO Den Haag, but after that the Alkmaar-based club remained unbeaten until 18 April, topping the table ahead of Twente and Ajax for the entire season, despite being predicted to finish as low as 13th by pundits. AZ had the best defensive record in the Eredivisie and the second-best goalscoring record, behind Ajax, thanks to its offensive duo of league topscorer Mounir El Hamdaoui and Brazilian Ari. They were crowned league champions on 19 April, one day after AZ suffered an unexpected loss at home to Vitesse, which ended a string of 28 unbeaten games (surpassing the team's 1980–81 record of 25 unbeaten games). That same day Ajax, the only opponent still in theory able to surpass AZ, lost 6–2 to PSV.
Louis van Gaal