(Adds details of wrongdoing, quotes from press conference)
WASHINGTON, July 14 (Reuters) - Citigroup Inc has agreed to pay $7 billion to resolve claims it misled investors about shoddy mortgage-backed securities in the run-up to the financial crisis, in a deal that includes the largest civil fraud penalty ever levied by the U.S. Justice Department.
The settlement, announced on Monday, is more than twice what many analysts expected but less than the $12 billion the government sought in negotiations with Citi, the third largest U.S. bank.
The accord came roughly six years after the height of the financial crisis. It is one of several Justice Department probes into the packaging and sale of risky home loans.
Many of the securities were marketed as safe, even though the banks knew they were destined to collapse. The widespread implosion of the securities fueled the 2007-2009 financial crisis.
Bank of America Corp has been negotiating with the Justice Department over similar claims, though those talks have stalled in recent weeks amid a multibillion dollar difference in proposed penalties.
"We're not letting up, and we're not going away," Tony West, the Justice Department's No. 3 official, said in announcing the Citigroup deal.
"We will continue to pursue these cases," he said, adding that related announcements could come "in the very near future."
Citigroup acknowledged it was aware that "significant percentages" of sample loans did not comply with underwriting guidelines but the bank pooled them into securities anyway.
In one 2007 deal, a Citigroup trader told colleagues in an email he had reviewed a due diligence report on the poorest quality loans, and that they "should start praying," according to the document.
Many of the loans listed unreasonable borrower incomes or home values below the original appraisals, the trader wrote, saying he "would not be surprised if half of these loans went down." Citigroup still securitized loans from the pool, according to the document.
The settlement, signed over the weekend, capped months of negotiations, during which the government threatened to sue the bank.
"The penalty is appropriate, given the strength of the evidence of the wrongdoing committed by Citi," U.S. Attorney General Eric Holder said in a statement on Monday.
"Despite the fact that Citigroup learned of serious and widespread defects among the increasingly risky loans they were securitizing, the bank and its employees concealed these defects," Holder added.
Earlier Monday, Citi said it took a related pretax charge of about $3.8 billion in the second quarter, which led the bank to report a 96 percent drop in earnings.
Citi shares rose 3.2 percent at $48.52.
Under the agreement, Citi will pay $4.5 billion in cash and provide $2.5 billion in aid to low-income tenants and struggling homeowners.
The cash portion consists of a record $4 billion civil payment to the Justice Department, double rival JPMorgan Chase & Co's penalty in November, and $500 million to resolve claims from five state attorneys general and the Federal Deposit Insurance Corp.
The Justice Department penalty resolves claims over both mortgage securities and more complicated securities known as collateralized debt obligations that the bank structured or underwrote between 2003 and 2008.
The consumer portion of the deal will include financing for the construction of affordable multifamily rental housing and principal reduction and forbearance for residential loans, due by the end of 2018.
Citi is the second major bank to settle with authorities since U.S. President Barack Obama in 2012 ordered the formation of a task force to investigate misconduct in the mortgage securities market.
JPMorgan, the No. 1 U.S. bank, has agreed to pay $13 billion to resolve related claims, including those from the Justice Department and regulators, and a $4 billion deal with the Federal Housing Finance Agency (FHFA).
Last year Citi settled with the FHFA for $250 million. The regulator of Fannie Mae and Freddie Mac had sued the bank over soured mortgage securities sold to the taxpayer-owned entities.
Investigators at the U.S. Attorney's offices in Brooklyn and Colorado and the FHFA inspector general's office collected some 25 million documents through nearly 50 subpoenas as part of the Citi probe that lead to the new settlement, authorities said. (Reporting by Aruna Viswanatha in Washington, with additional reporting by Anil D'Silva in Bangalore; Editing by Karey Van Hall, Saumyadeb Chakrabarty and Jeffrey Benkoe)