MINNEAPOLIS - The Minnesota Twins and free-agent right-hander Ervin Santana were working Thursday to finalize a four-year, $55 million contract, according to two people with direct knowledge of the deal.

The agreement was reached in San Diego at baseball's winter meetings. The two people spoke to The Associated Press on condition of anonymity because the contract had not yet been signed. Included in Santana's guarantee is a $1 million buyout of a fifth-year option on the deal.

The Twins again brought a need for better starting pitching into the off-season, and Santana has been one of the steadiest around. Over the last five years, Santana averaged 12 wins, 207 innings and 164 strikeouts while making 30 or more starts each season. The Twins pursued him a year ago, but he held out until March and signed with Atlanta for one season and $14.1 million.

Santana, who turns 32 Friday, was 14-10 with a 3.95 ERA in 31 starts for the Braves last year.

The Twins spent aggressively on starting pitching last winter, signing free agents Ricky Nolasco ($49 million), Phil Hughes ($24 million) and Mike Pelfrey ($11 million), who had previously joined the team for 2013 on a one-year deal. Nolasco was given the richest contract for a free agent in Twins history.

The Twins have had the worst collective ERA by their starting pitchers in the major leagues the last two seasons (5.06 in 2014 and 5.26 in 2013), and only the Colorado Rockies were higher than their 5.40 mark in 2012. Hughes was a major upgrade for the group last year, posting a 3.52 ERA and a 16-10 record with 186 strikeouts in 209 2-3 innings. But other than Kyle Gibson, who was up and down in his second season in the majors, the Twins offered little resistance to hitters around the rest of the league. Nolasco struggled badly in his first year.

General manager Terry Ryan said last week that the rotation was the priority for yet another winter.

"We've had a struggle on the mound so we'll continue to look at pitching first," Ryan said.

Santana was picked for the All-Star game in 2008, his fourth of eight seasons with the Los Angeles Angels, who traded him to the Kansas City Royals for 2013. Because Santana turned down a qualifying offer from the Braves, his signing comes with draft-pick compensation. The Twins must forfeit their second-round selection next year.

With Santana, Hughes, Gibson and Nolasco in line for the first four spots, Pelfrey will likely compete in spring training with prospects Trevor May and Alex Meyer for the fifth slot in the rotation with Tommy Milone also in the mix. Santana has made three career starts at Target Field, going 2-0 with a 3.10 ERA and 14 strikeouts in 20 1-3 innings.

___

AP Sports Writer Ronald Blum contributed to this report from San Diego.