MINNEAPOLIS -- Phil Hughes probably needed to leave hitter-friendly Yankee Stadium, and the Minnesota Twins were desperate for proven arms to strengthen a woeful rotation. The two parties have come together, hoping to help each other out.

The Twins and Hughes agreed to a $24 million, three-year deal, a person with knowledge of the agreement told The Associated Press. The person requested anonymity because Hughes still has to pass a physical before the contract can become official. The Star Tribune of Minneapolis had earlier reported the deal.

Hughes went 4-14 with a 5.19 ERA last season for the New York Yankees. He was 1-10 with a 6.32 ERA at Yankee Stadium though, so a move to pitcher-friendly Target Field could be exactly what the 27-year-old needs to jumpstart his career.

He was an All-Star in 2010 when he went 18-8 with a 4.19 ERA and was shaping up as a building block for the Yankees' rotation. Hughes was a former first-round draft pick and a once coveted young pitcher by many teams. Among them was the Twins, who had discussions with the Yankees about Hughes headlining a package for ace Johan Santana after the 2007 season.

The Yankees eventually pulled out of the talks, in part because of how highly they thought of Hughes, and the Twins sent Santana to the Mets.

But Hughes developed shoulder problems in 2011 that limited him to 17 starts and has been underwhelming the past two seasons while also dealing with back problems. Hughes has made 61 starts in the past two years, and Twins hope that getting him into spacious Target Field could help him stabilize one of the worst pitching staffs in the majors.

The Twins have lost at least 96 games in each of the last three seasons, mostly because of their starting pitching. Last year, their starters had an MLB-worst ERA of 5.26. Toronto was the next worst at 4.81. Only two of their starters had ERAs under 5.00, with Samuel Deduno's 3.83 leading the way and Kevin Correia next at 4.18.

Upgrading the rotation was by far the biggest priority for the team entering this winter, and the Twins have plunged into the task with uncharacteristic free-spending verve. They kicked things off by agreeing to terms with Los Angeles Dodgers right-hander Ricky Nolasco on a $49 million, four-year contract last week.

They have now committed $73 million on Hughes and Nolasco, the two biggest contracts the franchise has given to players outside the organization.

And the Twins may not be done. They have been in discussions to retain veteran Mike Pelfrey while looking at other free agents, including Bronson Arroyo and Matt Garza. It would, however, be somewhat surprising to see them add another high-priced starter after landing Nolasco and Hughes.

The club could also bring back veteran catcher A.J. Pierzynski, who started his career in Minnesota but was traded to make room for Joe Mauer. The Twins announced earlier this offseason that Mauer will be moved to first base, creating a need for a veteran behind the plate.