“They appear to have grossly inflated the settlement amount for P.R. purposes to mislead the public, while in the fine print, enabling Goldman Sachs to pay 50 to 75 percent less,” said Dennis Kelleher, the founder of the advocacy organization Better Markets, referring to the government announcement. “The problem all along, with all of these settlements — and this one highlights it even more — is that they are carefully crafted more to conceal than reveal to the American public what really happened here — and what the so-called penalty is.”

A Justice Department official with direct knowledge of the negotiations, who spoke on the condition that his name not be disclosed, said that the banks were given extra credit for activities that the government wanted to encourage, like funding development of low-income housing or providing relief to areas hit by natural disasters. But he also said that the final terms were a result of a back and forth between the banks and government officials.

Goldman is the last of the big American banks to reach a settlement with the national working group that was set up in 2012 to investigate how Wall Street exacerbated the mortgage bubble and ensuing financial crisis. The group included several federal regulators and state attorneys general.

The final bill for Goldman is less than the settlements of mortgage giants like JPMorgan, which the government said was paying $13.3 billion, but more than the $3.2 billion settlement the government secured with Goldman’s closest competitor, Morgan Stanley.

The special credits negotiated by the banks are laid out in annexes connected to each settlement.

JPMorgan Chase, for instance, earned a $1.15 credit toward its settlement requirements for each dollar of loan forgiveness it offered within the first year, according to the settlement it completed in 2013. Goldman, in contrast, is getting $1.50 of credit for each dollar of loan forgiveness within the first six months after the settlement — an additional incentive that JPMorgan did not receive. JPMorgan also did not get the 70 percent discount on money going to affordable housing.