The Red Sox have announced the hiring of John Farrell as their new manager and his agreement to a three-year deal that will run through 2015. As compensation to the Blue Jays, to whom Farrell was under contract through 2013, the Red Sox traded shortstop Mike Aviles for right-hander David Carpenter.

The Red Sox confirmed in their press release they sought and received permission from the Blue Jays to talk directly to Farrell and made the agreement late last night. Blue Jays GM Alex Anthopoulos told reporters, including Shi Davidi of Sportsnet.ca (via Twitter), that Farrell approached him one week after the season to tell him, if the opportunity to manage in Boston came up, he wanted to pursue it calling it a dream job.

"I’m extremely excited to be returning to the Red Sox and to Boston," said Farrell in the Red Sox's statement. "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."

"We are thrilled to name John Farrell as our new manager," said Executive Vice-President/General Manager Ben Cherington, who made the announcement. "John has been a major league pitcher, front office executive, coach, and manager. His broad set of experiences, 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."

Aviles saw his role reduced towards the end of the season in Boston as the club slotted Jose Iglesias in as the starting shortstop for the bulk of September. The 31-year-old took a step back offensively in 2012 as he hit just .250/.282/.381 with 13 homers. In parts of five big league seasons for the Royals and Red Sox, Aviles owns a .277/.308/.408 batting line. Aviles, who earned $1.2MM last season, will head to arbitration once again this winter and is set to hit the open market after the 2014 season.

This marks the second time that Carpenter has been traded this year, as he went from the Astros to Toronto in a ten-player deal this summer. The 27-year-old appeared in 33 games for the two clubs last season, posting a 8.07 ERA with 8.6 K/9 and 4.5 BB/9. He also had a 3.08 ERA with 8.5 K/9 and 2.4 BB/9 in 23 Triple-A appearances.

Boston had been linked to Farrell, their former pitching coach, ever since Bobby Valentine appeared to be losing his grip on the club this year. Meanwhile, Blue Jays General Manager Alex Anthopoulos repeatedly deflected questions about the possibility of Farrell returning to the Red Sox and even instituted a club policy of blocking personnel from leaving for a lateral move.

Two compensation deals for baseball decision makers were completed last season. Theo Epstein went from the Red Sox over to the Cubs' front office while manager Ozzie Guillen was traded from the White Sox to the Marlins. The White Sox received Double-A reliever Jhan Marinez and Triple-A shortstop Ozzie Martinez for their skipper. While both were ranked highly within the Marlins' farm system, neither player is viewed as an elite prospect. Meanwhile, the Cubs and Red Sox had a long protracted battle over what Epstein's compensation package should be before finally agreeing upon pitching prospects Chris Carpenter and Aaron Kurcz going to Boston for Jair Bogaerts.

Sean McAdam of CSNNE.com (via Twitter) was the first to break the news of Farrell's hiring. Rob Bradford of WEEI.com first reported the inclusion of Aviles and, along with colleague Alex Speier, Carpenter.

Edward Creech contributed to this post.