Image caption Deutsche Bank took responsibility for the actions at MortgageIT subsidiary

Germany's Deutsche Bank has agreed to pay $202m (£125m) to settle charges it defrauded the US government over the resale of risky mortgages.

The US Department of Justice said Deutsche's MortgageIT subsidiary lied to get Federal Housing Administration (FHA) insurance for its loans.

The bank admitted responsibility , which cost the federal government $386m when the mortgages defaulted.

Deutsche said it wanted "to put this issue behind us".

FHA rules state lenders must make sure the borrower will be able to repay the loan, but the justice department had argued Deutsche did not do so.

Deutsche bought MortgageIT for $430m in 2007.

The government said that between 1999 and 2009, MortgageIT endorsed more than 39,000 mortgages for FHA insurance and the lender had powerful incentives to generate as many FHA-insured loans as it could so that it could then sell them on to investors.

On Thursday, federal prosecutor Preet Bharara said Deutsche treated the federal insurance as "free government money to backstop lending practices that did not follow the rules".

"Their failure to meet these requirements caused substantial losses to the government - losses that could have and should have been avoided."

As part of the settlement, Deutsche accepted responsibility that its executives "were in a position to know that the operations of MortgageIT did not conform fully" to US regulations.

The global financial crisis was sparked by mortgages being given to people who could not afford them, with the debt then being repackaged and sold on to investors.