Shortstop Mike Aviles will head to Toronto, and the Red Sox will receive right-hander David Carpenter in return, the Red Sox have announced. News of the deal first came out late Saturday night.
"I'm extremely excited to be returning to the Red Sox and to Boston," Farrell said, according to a Red Sox news release. "I love this organization. It's a great franchise in a special city and region, with great fans, and we want nothing more than to reward their faith in us."
Farrell, 50, has been signed to a three-year contract that will go through 2015, according to the Red Sox. He was the Boston pitching coach from 2007-2010 before spending two years as Toronto's manager. The Blue Jays were 154-170 in his time there.
"We are thrilled to name John Farrell as our new manager," general manager Ben Cherington said, according to the news release. "John has been a major league pitcher, front office executive, coach and manager. His board set of experience, and exceptional leadership skills, make him the ideal person to lead our team.
"I have known him in various capacities throughout my career, and I hold him in the highest regard as a baseball man and as a person."
Farrell was also the director of player development for the Indians from 2001-2006.
Aviles, who came to the Red Sox partway through the 2011 season, leaves Boston with 136 games played, 128 of them at shortstop. He went .250 with 13 home runs and 60 RBIs last season.
Carpenter, 27, has made appearances in 67 games, all as a relief pitcher. He struck out 60 batters in 60 innings between the Astros, where he played in 2011-2012, and the Blue Jays. He is 1-5 with a 5.70 ERA and one save in the major leagues.
Carpenter was originally a catcher before taking up pitching in 2008.