LAS VEGAS - CC Sabathia and the New York Yankees agreed yesterday on the framework of a $161 million, seven-year contract, the richest for a pitcher in baseball history.

The Yankees and Sabathia's agents still need to work out all the details. The 28-year-old lefthander will be able to opt out of this contract after three seasons and become a free agent again.

"There's a lot of layers in the process, [and] until that process is completed, I'm kind of prevented from saying too much," Yankees general manager Brian Cashman said. "Legally, I've got to protect myself. And, you know, you're never done until you're done."

Cashman made a six-year offer to the former AL Cy Young Award winner Nov. 14, the first possible day to negotiate with free agents, and met with Sabathia in Las Vegas on Sunday and Monday.

Sabathia will give the Yankees a new marquee star as they head into the new $1.3 billion Yankee Stadium, where seats sell for up to $2,500 each. His deal will top the previous mark for a pitcher, a $137.5 million, six-year contract agreed to by Johan Santana and the New York Mets last winter. Sabathia's $23 million average salary is just ahead of Santana's $22.9 million

Among all players, the deal will trail only Alex Rodriguez's $275 million, 10-year contract with the Yankees, A-Rod's earlier $252 million, 10-year agreement with Texas, and Derek Jeter's $189 million, 10-year contract with the Yankees.

"I'm sure every team in baseball would love to have him," Jeter said. "He's a guy who's an intimidating factor on the mound."

Signing Sabathia was the No. 1 off-season priority for the Yankees, whose streak of 13 consecutive playoff appearances ended this year. He would join a rotation that includes Chien-Ming Wang and Joba Chamberlain.

"He's lefthanded. He's a tremendous competitor. His talent is obvious," Cashman said.

New York hopes to re-sign Andy Pettitte, who also is a free agent, and has had talks this week with Ben Sheets and the agents for A.J. Burnett.

Many of Sabathia's questions to the Yankees had been about what it would be like to pitch in New York, and part of the reason Cashman traveled to California was to meet with Sabathia's wife, Amber, along with the player, to discuss that issue.

"The only times people tend to struggle is when they put pressure on themselves," Jeter said. "It's still the same game whether you're playing in New York, or you're playing in Cleveland, Milwaukee, Tampa."

Milwaukee acquired Sabathia from Cleveland in July, and he went 11-2 for the Brewers. Sabathia was a workhorse, throwing seven complete games and three shutouts in 17 starts as the Brewers made the playoffs for the first time since 1982.

In his career, he is 117-73 with a 3.66 ERA.

GM Doug Melvin, who had offered a five-year deal worth about $100 million, said he was notified at 7:30 a.m. yesterday that the Brewers were no longer in the running.

"We put our best foot forward," Melvin said. "We made a substantial offer. But it appears it would not have made a difference, anyway."