AC Milan
After three seasons on the Inter books, Pirlo was sold to rivals AC Milan for 33 billion Italian lire (€17,043,078) on 30 June 2001, the last day of the 2000–01 financial year. The transfer fee was partially funded by the movement of Dražen Brnčić in the opposite direction for an undisclosed fee. In the same window Inter swapped Cristian Brocchi (25 billion lire; €12.9 million) for Guly (undisclosed fee; €8.537 million profit) and Matteo Bogani for Paolo Ginestra. The deals were later reported by the Italian press to have been undertaken to create "false profit" by inflating the players' values in the transfer fees in the swap deal. The exchange involving Ginestra and Bogani created an approximate €3.5 million "profit" for both clubs, but this actually manifested itself in terms of useless registration rights.
It was at Milan, in particular under manager Carlo Ancelotti, where Pirlo made big strides in developing into a world class player, and one of the best deep-lying playmakers and set-piece specialists in the world, as he went on to achieve notable domestic and international success during his time with the club. Pirlo later recalled the period he has spent in Milan with Ancelotti: "He changed my career, putting me in front of the defence. We shared some unforgettable moments. We had a magnificent past together." After Mazzone's pioneering decision to move Pirlo into a deep-seated playmaking role with Brescia during the previous season, Milan managers Fatih Terim and, in particular, Carlo Ancelotti further developed this role for him at Milan. In Ancelotti's 4–3–1–2 and 4–3–2–1 formations, Pirlo was deployed as a deep-lying playmaker in front of the defence, which allowed him to play alongside other talented attacking midfielders, such as Rivaldo, Rui Costa and eventually Kaká, replacing the gap left by Milan legend Demetrio Albertini in the deep midfield playmaking role. He would become an integral part of the Rossoneri's midfield, forming a formidable partnership with Gennaro Gattuso, as well as with Clarence Seedorf and Massimo Ambrosini, who also supported his playmaking role defensively. Pirlo was given the nickname the metronome during his time at the club, for the way in which he set the team's rhythm.
Pirlo made his Milan debut on 20 September 2001, in a 2–0 win over BATE Borisov in the UEFA Cup, after coming on for Massimo Donati. During his first season with the club, he helped the team to a fourth-place finish UEFA Champions League qualification spot, also reaching the semi-final of the UEFA Cup, the club's best ever result in the competition. On 30 March 2002, he scored his first goal with Milan in a 3–1 home win over Parma, from a free kick.
Pirlo led Serie A in the 2002–03 season in four categories – passes played (2589), ball possession (123 hours played and 39 minutes), successful balls (661), and successful passes (2093); he averaged almost 90 passes per game throughout the season. During this season, his second with the club, he also managed a career-best of 9 goals in Serie A, as Milan finished the league in third place, also winning the Coppa Italia over Roma, and the UEFA Champions League, beating out Italian rivals and 2003 Serie A champions Juventus in the final 3–2 on penalties, following a 0–0 draw after extra-time. The following season saw Pirlo win the 2003 UEFA Super Cup with Milan over Porto, although the Rossoneri lost to Juventus on penalties in the 2003 Supercoppa Italiana following a 1–1 draw after extra time; during the match, Pirlo scored on a penalty in extra time, and once again in the shoot-out. Milan would also miss out on the 2003 Intercontinental Cup, losing out on penalties once again, to Boca Juniors, following a 1–1 draw after extra-time; on this occasion, Pirlo missed his penalty in the shoot-out, after previously setting up Milan's opening goal of the match. Pirlo would celebrate winning his first Serie A title with Milan during the 2003–04 season however, following up the scudetto with the 2004 Supercoppa Italiana over Lazio.
Milan finished as runners-up in Serie A to Juventus in the 2004–05 season. In the 2004–05 UEFA Champions League, Pirlo finished as one of the second-highest assist providers with four assists, as he helped Milan to reach the final. In the 2005 UEFA Champions League final against Liverpool, on 25 May, Pirlo assisted Paolo Maldini's opening goal, after 50 seconds, from a free kick, and combined with Kaká before the Brazilian unleashed Hernán Crespo with a long pass for Milan's third goal before halftime. In the second half, however, Liverpool made a three-goal comeback, sending the match into extra time. After a 3–3 deadlock, the match went to penalties, and Milan were defeated by the English team in the shoot-out. Despite Pirlo's performance throughout the competition and in the final, Pirlo had missed his penalty kick during the shoot-out in the final when it was saved by Jerzy Dudek. Pirlo would later state in his autobiography that the 2005 UEFA Champions League final defeat on penalties was the worst moment of his career, and that he had considered retiring prematurely following the match.
The following season, Milan once again finished in second place behind Juventus in Serie A (before their 30-point deduction due to their involvement in the 2006 Calciopoli scandal), also reaching the semi-finals of the UEFA Champions League, only to be defeated by eventual champions, Barcelona, and the quarter-finals of the Coppa Italia. In 2006, Pirlo placed 9th in the Ballon d'Or, which was won by his Italy teammate Fabio Cannavaro, and was elected to the 2006 FIFPro World XI.
Andrea has demonstrated all his great talent and worth. When we played together, everything started with him. He always had the great gift of being able to visualise and anticipate plays before everyone else. His vision, what he can do with the ball, and what he's able to create, make him a true superstar. Andrea has something which you don't see very often.
Pirlo led Milan in minutes played for the 2006–07 season with 2,782 across 52 appearances, as he went on to win his second UEFA Champions League title with Milan, also helping his team to a fourth-place finish in Serie A, and another Coppa Italia semi-final. In the second leg of the UEFA Champions League semi-final against Manchester United, Pirlo set up Seedorf's goal, as Milan progressed on to the final. In the 2007 UEFA Champions League final in Athens, Pirlo assisted Inzaghi's first goal from a free kick, helping Milan to defeat Liverpool 2–1, avenging their 2005 final defeat in Istanbul. During the 2007–08 season, Pirlo won his second UEFA Super Cup with Milan, assisting Milan's second goal in the final, and winning the Man of the Match award; he also contributed to the club's first ever FIFA Club World Cup title in 2007, once again setting-up Milan's second goal in the final. In October 2007, he was nominated for the 2007 Ballon d'Or, the 2007 FIFA World Player of the Year, and the 2007 International Federation of Football History & Statistics (IFFHS) World's Best Playmaker Awards, but they were all won by Milan teammate Kaká, as Pirlo placed 5th in the Ballon d'or, 7th in the FIFA World Player of the Year, and 2nd in the World's Best Playmaker Awards. Despite a strong start, Milan suffered a dip in form during the second half of the season, finishing the league in fifth place, failing to qualify for the UEFA Champions League; Milan also suffered eliminations in the round of 16 of the UEFA Champions League and the Coppa Italia that season. The following season, Milan managed a second-place finish in Serie A, alongside Juventus, and behind local rivals Inter, while they were eliminated in the round of 32 of the UEFA Cup, and the round of 16 of the Coppa Italia.
After Kaká and Ancelotti left Milan in the summer of 2009, Chelsea tested Milan's resolve by bidding $12 million and Claudio Pizarro for Pirlo. The club rejected the offer and Pirlo was said to be contemplating a transfer request. On 5 August, club owner Silvio Berlusconi decided not to sell Pirlo, who said he was overjoyed and wanted to end his career at Milan. On 21 October 2009, Pirlo scored a notable 30-metre goal in Milan's 3–2 win over Real Madrid in the UEFA Champions League; Milan were eventually eliminated in the round of 16. Milan finished the season with a 3rd place in Serie A, and a quarter-final finish in the Coppa Italia under new manager Leonardo.
The following season saw Milan dominate the league. Milan played host to Genoa on 25 September 2010, with Pirlo providing a lifted ball over the top of the defence to set striker Zlatan Ibrahimović free to score the solitary goal of the game. On 2 October, Pirlo scored a 40-yard goal against Parma to give Milan their first away win of the 2010–11 season. On 14 May 2011, Pirlo appeared in his last match for Milan, coming on as a half-time substitute for Ambrosini as the club celebrated their Serie A title with a 4–1 victory over Cagliari. Four days later, Pirlo confirmed that he would be leaving Milan at the end of the 2010–11 season, after a mutual decision not to renew his contract. In his last season in Milan, Pirlo appeared in the league just 17 times under manager Massimiliano Allegri, registering one goal and three assists. He won his second Serie A title with Milan that season, and also reached the round of 16 in the UEFA Champions League as well as the semi-final stage in the Coppa Italia.
In total with Milan, Pirlo made 401 appearances, scoring 41 goals. With the club, he won two Serie A titles in 2004 and 2011, as well as two UEFA Champions League titles in 2003 and 2007, also reaching the final in 2005; he also won a Coppa Italia in 2003, a Supercoppa Italiana in 2004, and two UEFA Super Cups in 2003 and 2007, as well as playing a key role in Milan's first ever FIFA Club World Cup title in 2007. During this period, Milan also finished as runners up in Serie A in the 2004–05 and the 2005–06 seasons, as well as finishing second on penalties in the 2003 Supercoppa Italiana, and in the 2003 Intercontinental Cup.