The New York Yankees have agreed to a three-year, $35 million deal with reliever Rafael Soriano, a source confirmed to ESPNNewYork.com.

Soriano will be an eighth-inning setup man for longtime closer Mariano Rivera.

According to a baseball official, the idea is that if Rivera retires after his two-year deal expires, Soriano, 31, will be the heir apparent at closer.

In fact, Rivera in some sense chose his own successor, going to bat for Soriano with Yankees brass to convince the team to sign him, a source with knowledge of the negotiations told ESPNNewYork.com's Wallace Matthews.

Sources told ESPN The Magazine's Buster Olney on Friday that there was a split of opinion in the Yankees organization over signing Soriano with ownership prevailing over baseball operations.

Before signing Soriano, the Yankees had talked about a possible sign-and-trade that would have netted them Grant Balfour. If completed, the Yankees would have saved their No. 1 draft -- a stated priority of general manager Brian Cashman last week. The Yankees tabled the Balfour talks, instead, as they negotiated the Soriano deal.

Balfour ended up agreeing to a deal with the A's, sources told ESPN.com's Jayson Stark on Friday.

Soriano must still pass a physical to complete the contract.

Soriano has player options after the first and second years of the deal, according to the source. In the first year, Soriano will receive $10 million and get an additional $1.5 million if he opts out. In the second year, he'll receive $11 million and an additional $1.5 million if he opts out. He'll get $14 million in the third year of his contract.

An official said the player options were the Yankees' idea because they wanted Soriano to be comfortable. At least one official in the organization thinks they have the best bullpen in baseball.

Soriano's contract does not include a no-trade clause, a source told Olney.