The rebuilding of the Twins’ starting rotation has begun, and Dodgers free agent Ricky Nolasco is part of the foundation.

The righthander, who won 89 games in 7½ seasons with the Marlins and three months with the Dodgers, agreed to the richest free-agent contract in Twins history, a $49 million package over four years, a team official confirmed on the condition he not be identified.

Nolasco, who turns 31 next month, will earn $12 million each season from 2014 to ’17, with the Twins holding an option on 2018 for $13 million, or a $1 million buyout. The 2018 option becomes Nolasco’s if he pitches a certain number of innings in 2017.

In both length and value, Nolasco’s contract is the biggest commitment the Twins have ever made to a player from outside their organization, easily eclipsing the three-year, $21 million pact that outfielder Josh Willingham signed two winters ago.

Word of Nolasco’s contract was first reported by the website MLBDailyDish.com, and the pitcher seemed to confirm the news himself a few minutes later, when he changed the avatar on his Twitter account to a Twins “TC” logo.

Nolasco joins lefthander Scott Diamond and righthanders Kevin Correia and Samuel Deduno in the Twins’ projected 2014 rotation, with several candidates — including other free agents that the Twins have approached this month — for the fifth slot. Several media reports have linked the team to free agents such as righthanders Matt Garza, Philip Hughes and Bronson Arroyo. In addition, according to CBSSports.com, the Twins have offered a two-year contract to righthander Mike Pelfrey, their own free agent.

The Twins starting rotation was the worst in the majors last season, posting a combined ERA of 5.26, nearly a half-run worse than next-worst Toronto’s 4.81. Only four pitchers contributed as many as 100 innings, with Correia by far the leader at 185, and only Deduno (3.83) had an ERA below 4.00.

So the Twins set out this winter to upgrade that staff with at least two new pitchers, and durability was considered a primary asset. “It’s no secret that we need guys to give us innings. Our starters didn’t do the job last year, and that piled too many innings on our bullpen,” General Manager Terry Ryan, who was unavailable for comment Wednesday, said earlier this month. “We need more innings.”

In Nolasco, they might have found some. A fourth-round draft pick by the Cubs in 2001, he has pitched at least 185 innings in five of the last six seasons, posting a career ERA of 4.37. His only stint on the disabled list during that time was for a torn ligament in his knee, not an arm injury.

Nolasco was 13-11 with a 3.70 ERA in 2013 overall and responded well to the pressure of a pennant race after being traded to the Dodgers for three minor leaguers on July 6. He went 8-3 with a 3.52 ERA over the final three months of the season, though he was the losing pitcher — giving up three runs in four innings against St. Louis — in his only postseason start.

CBSSports.com also reported that the Twins are discussing a contract with free-agent catcher Jarrod Saltalamacchia to fill the position left vacant when Joe Mauer announced he is moving to first base.