Photo

The stage was set for another public shaming of a Wall Street bank.

The Justice Department flew in a prosecutor from Colorado and planned for a news conference in Washington to announce a lawsuit against Citigroup over mortgage securities that had imploded during the financial crisis.

But an event a world away unexpectedly changed the Justice Department’s plans that day in June. The capture of a suspect in the deadly attack on the United States Mission in Benghazi, Libya, led federal prosecutors to conclude that those headlines would overshadow the Citigroup case. The prosecutors, knowing that the Citigroup case represented one of their last chances to send a public message that the government was holding Wall Street accountable for the crisis, were loath to squander that opportunity.

“We’ve got a lot going on right now, so we’re putting the lawsuit temporarily on hold,” Tony West, the government’s lead negotiator and the Justice Department’s No. 3 official, said to the bank’s lawyers in a phone call just hours after he told them that a lawsuit was coming, according to people briefed on the matter.

That twist of fate — which some bank officials viewed as the Justice Department looking to escape its own costly legal battle — opened the door to last-minute negotiations that have now culminated in a $7 billion settlement the government expects to announce on Monday, the people briefed on the matter said.

The deal caps months of contentious talks that began with a $363 million offer by Citigroup followed by a $12 billion demand from the Justice Department, the people said, a yawning gap that stemmed from the radically divergent methods used to calculate the cost of the settlement. Citigroup linked its initial offer to the bank’s relatively small share of the market for mortgage securities, the people said. The Justice Department, however, rejected that argument, emphasizing instead what it saw as Citigroup’s level of culpability based on emails and other evidence it had uncovered.

A behind-the-scenes account of the negotiations, based on interviews with the people briefed on the matter, shows that the government’s bargaining position in mortgage cases often hinges on a desire to destroy Wall Street’s argument that market share should dictate punishment.

The dollars and cents of the final Citigroup settlement reflect that strategy. Citigroup had already raised its offer to $7 billion — the same size as the final settlement — when the Justice Department planned to announce the lawsuit last month. The main breakthrough toward a settlement took a simple feat of accounting: The bank agreed to shift a portion of the settlement from state attorneys general to the Justice Department, preventing Citigroup from claiming a tax deduction on the settlement. More important for the Justice Department, that move meant that the bank would pay a far heftier sum than one based entirely on its share of the market for mortgage securities.

The mortgage cases, interviews show, often boil down to a game of showmanship. For the Justice Department, criticized for never indicting a Wall Street chief executive and under pressure from Congress to crack down, the cases support a broader effort to project the image of a tough enforcer.

The Citigroup settlement also raises the stakes for the Justice Department’s next largest target, Bank of America. Talks between prosecutors and Bank of America are expected to ramp up now that the Citigroup settlement is finished. The Justice Department is also likely to seek mortgage deals from banks like Goldman Sachs and Wells Fargo.

The mortgage settlements are one item of unfinished business left from the financial crisis. Since 2008, the housing market has rebounded, the economy has improved and Congress has passed new laws to rein in Wall Street excess. Yet the Justice Department’s investigations into whether banks duped investors into buying defective mortgage securities have stalled the banks’ efforts to move on and ignited tensions with the government.

The Citigroup case includes a $4 billion cash penalty to the Justice Department as well as $2.5 billion in so-called soft dollars earmarked for aiding struggling consumers and $500 million to state attorneys general and the Federal Deposit Insurance Corporation. The deal also requires Citigroup to hire an independent monitor — Thomas J. Perrelli, a lawyer at Jenner & Block and former Justice Department official — who will keep an eye on the bank to ensure it follows the terms of the settlement.

At the outset, the bank expected to pay a fraction of that $7 billion.

The two sides met multiple times last year in Colorado and New York. A crucial meeting came last November at the library in the office of the United States attorney for the Eastern District of New York, in Brooklyn, which was investigating the case along with the United States attorney’s office in Colorado and the Justice Department in Washington.

The meeting, which took place on the same day the Justice Department announced its record $13 billion settlement with JPMorgan Chase over that bank’s sale of mortgage securities, exemplified the debate over market share. Using the JPMorgan settlement as a template, Citigroup’s lawyers, from Paul, Weiss, Rifkind, Wharton & Garrison, argued that their client faced a far smaller settlement. After all, Citigroup had sold roughly half as many mortgage securities as JPMorgan had through its various subsidiaries.

But Geoffrey Graber, who runs a Justice Department task force that handled the cases against Citigroup and JPMorgan as well as a suit against the ratings agency Standard & Poor’s, warned the lawyers not to draw too close a parallel, the people said.

“There’s no way you’ll get anywhere with us if you are only going to make the market share argument,” he told one Citigroup lawyer.

By April, Citigroup had made its first settlement offer. But the bank’s opening bid of $363 million was swiftly rebuffed. The government did not even bother to make a counteroffer, the people said, telling the bank to come back with something better.

After balking, Citigroup raised its offer to $700 million, again basing that figure largely on an analysis of its market share.

That only aggravated the situation. On the last weekend of May, lawyers from Paul Weiss and Citigroup’s general counsel were all in Cambridge, Mass., attending Harvard graduations, when they received an email from Mr. West. The Justice Department, Mr. West said in the email, was demanding a settlement of $12 billion, including a mix of cash penalties and relief for consumers.

Inside the bank, frustrations grew. Executives grumbled that prosecutors were making unfair and arbitrary demands. Citigroup raised its offer, but only slightly, to $1 billion.

Time was running out. Prosecutors had set a deadline of June 13 for Citigroup to present its best offer. Although Theodore Wells Jr. and Brad Karp, two of the bank’s lawyers at Paul Weiss, sought an extension, Mr. West and Mr. Graber said no.

With only hours to go, Citigroup was dealt a rude shock. News reports indicated that the Justice Department was planning to sue the bank.

To Citigroup, the message from the Justice Department was clear: Ratchet up the offer or face a long and bruising court battle. That evening, with the threat looming, Mr. Wells phoned Mr. West to raise the prospect of a broader settlement that would include state attorneys general from California and elsewhere, as well as the F.D.I.C. Mr. West — whose sister-in-law happens to be the attorney general of California — suggested an extra $900 million payment for the states and the F.D.I.C.

The proposal, while theoretical, gave Citigroup some extra time. And so over Father’s Day weekend, its board met to consider the Justice Department’s demands, even as it prepared to defend against a lawsuit.

Then, as the next week began, Citigroup raised its offer to $3.6 billion in cash to the Justice Department, $2.5 billion in consumer relief and $900 million to the states and the F.D.I.C.

But the offer came with a catch: In exchange for the extra payouts, the bank wanted the Justice Department to forgo any potential cases against Citigroup over collateralized debt obligations, complex financial instruments the bank sold in the years before the crisis. Paul Weiss relayed the offer to Mr. West, who struck an optimistic tone — but also demanded more cash.

When the bank declined to raise its offer further, the people briefed on the matter said, Mr. West met with Attorney General Eric H. Holder Jr. to discuss the Justice Department’s options. Rather than lower the demands, Mr. Holder authorized the lawsuit. The decision prompted a lead prosecutor in the case, John Walsh, the United States attorney in Colorado, to fly out to Washington. Mr. West then called Paul Weiss to say that the case was going to be filed the next day.

But just a few hours later, after another Citigroup board meeting, Mr. West’s number reappeared on Mr. Wells’s cellphone. Mr. West was calling to say that an arrest had been made in Libya, and the Justice Department was temporarily postponing the suit.

“It looks like Citi got a reprieve,” Mr. West said, according to the people briefed on the matter, while adding that he was “always open to talk.”

Within weeks, Mr. West agreed to Citigroup’s request to forgo cases related to collateralized debt obligations and offered to shift $400 million from the state attorneys general and the F.D.I.C. to the Justice Department, forming the basis of the current settlement.

“That’s tough,” Mr. Wells said, “but if it buys us global peace, then I think we can get this done.”