Vikram Pandit’s last day at Citigroup swung from celebratory to devastating in a matter of minutes. Having fielded congratulatory e-mails about the earnings report in the morning that suggested the bank was finally on more solid ground, Mr. Pandit strode into the office of the chairman at day’s end on Oct. 15 for what he considered just another of their frequent meetings on his calendar.

Instead, Mr. Pandit, the chief executive of Citigroup, was told three news releases were ready. One stated that Mr. Pandit had resigned, effective immediately. Another that he would resign, effective at the end of the year. The third release stated Mr. Pandit had been fired without cause. The choice was his.

The abrupt encounter, described by three people briefed on the conversation, included a terse comment by the chairman, Michael E. O’Neill: “The board has lost confidence in you.”

A stunned Mr. Pandit chose to resign immediately. Even though Mr. Pandit and the board have publicly characterized his exit as his decision, interviews with people close to the board describe how the chairman maneuvered behind the scenes for months ahead of that day to force Mr. Pandit out and replace him with Michael L. Corbat, the board’s chosen successor.