The agreement includes a $100m fine and $370m in consumer relief to borrowers.
Investigations began in 2010 after HSBC was found to be signing off foreclosure documents without proper review.
In a statement, the bank's chief executive Kathy Madison called the agreement a "positive result."
The consumer relief will require the bank to cut the loan amount on mortgages for homeowners close to default. HBSC will also be required to change internal practices like foreclosing on homeowners who are being considered for a loan modification.
"The agreement is part of our ongoing effort to address root causes of the financial crisis," said the head of the Justice Department's Civil Division Benjamin Mizer.
The deal settles claims with 49 states, the District of Columbia and the federal government.
HSBC's agreement is similar to deals that were given to US banks including JP Morgan and Bank of America in 2012.
HSBC has reached a $470m (Â£325m) settlement with the US government and states related to dubious mortgage lending and foreclosure practices that contributed to the financial crisis.