As part of the deal, Leonardo Spinazzola is headed to the Italian capital for €29.5 million.
The transaction allows Juventus to make a significant profit ahead of a summer of hefty spending.
Free agent Adrien Rabiot landed in Turin on Sunday to sign a four-year contract that would reportedly make him one of the highest earners in Serie A.
Pellegrini, who's unrelated to Roma midfielder Lorenzo Pellegrini, came through the club's academy and made his senior debut in a 4-0 win over Frosinone in September. The 20-year-old spent the second half of last season on loan at Cagliari and rounded out the campaign with two assists.
Spinazzola returned from a transformative loan spell at Atalanta to become Juventus' second-choice left-back. Adept with both of his feet, the 26-year-old played on both the left and right side.
He made his Serie A debut at Atalanta in August 2014 and went on to star for the Bergamaschi as a wing-back. His enterprising play and ambidexterity convinced Juventus to call him back.