Flamini, 24, arrived in Milan late Sunday and underwent medical tests at Milan's camp before signing his new contract.
"We informed Arsenal about what we are doing. We acted following the UEFA rules. We believe that Flamini is a great player," La Gazzetta dello Sport quoted Milan vice president Adriano Galliani as saying.
"He is not here to replace (Gennaro) Gattuso, he can play in any midfield role."
Rumours that Gattuso, 30, considers leaving Milan circulated in recent weeks and were fuelled on the weekend by the presence of Paul Breitner, a Bayern Munich market manager, in Milan.
Breitner was at the Giuseppe Meazza during the city derby that Milan won 2-1 against Inter Milan. Bayern, who have just secured the German Bundesliga title, were also keen on Flamini, but seem now to have set their sights on Gattuso.
Milan did not pay any transfer fee for Flamini as his contract with Arsenal expires in June. He is expected to earn 4 million euros (6.1 million dollars) per season at Milan.