The 22-year-old arrived in Milan on Tuesday and signed the contract on Wednesday after successfully passing his medical.
"I chose Milan for many reasons," said Bojan. "It is a great club and the team is made of an historic group of players.
"I want to thank the coach (Massimiliano Allegri), who wanted me so much, by playing at my best."
Bojan joined Roma from Barcelona last summer, scoring seven goals in 33 Serie A appearances in the 2011-12 season.