Before agreeing to take the top seat at Credit Suisse First Boston, John Mack was in talks to join Merrill Lynch & Co. , a source familiar with the situation told The Post.

According to the source, Mack, the former president of Morgan Stanley Dean Witter, had held extensive conversations with Merrill Chief Executive David Komansky in recent months about succeeding him as chief executive officer when he retires.

Those conversations are believed to have ended about three or four weeks ago.

It was unclear why the talks ended. A spokesman for Mack said he was not available for comment, while a Merrill spokesman also declined comment.

Komansky is supposed to announce his recommendation for his successor to Merrill’s board by the end of the year.

“The three contenders at Merrill Lynch have got to be breathing a sigh of relief, because here was this super-natural guy, and everybody knew that he’d have to land somewhere,” noted Wall Street veteran Kim Fennebresque, president and chief executive officer of SG Cowen Securities Corp.

The three internal contenders for Komansky’s job are Stanley O’Neal, head of retail brokerage; Jeffrey Peek, head of asset management, and Tom Davis, head of Merrill’s corporate and institutional client group.

For Merrill, the idea of bringing in someone such as Mack would have been a stark departure from the firm’s longtime strategy.

“Bringing in someone from outside the firm would have been uncharted territory for Merrill Lynch,” said Mark Constant, a brokerage analyst at Lehman Brothers.

Meanwhile, industry observers said Mack’s decision to join CSFB instead of Merrill made a lot of sense. “CSFB offers a much cleaner slate for him. He can wield a bigger ax there.”