The U.S. state of Massachusetts has reached a multimillion dollar settlement with Goldman Sachs Group Inc regarding subprime mortgages, state Attorney General Martha Coakley said on Monday.

The settlement follows an investigation into the role of investment banks in the securitization and origination of mortgages and includes both a monetary payment and extensive relief to homeowners, the attorney general's office said in a statement.

Goldman spokesman Michael DuVally declined to comment.

Subprime mortgages, loans to buyers with poor credit, played a major role in the creation of the U.S. housing bubble earlier this decade. The deflation of that bubble was a major contributor to the worldwide recession.

(Reporting by Scott Malone; Additional reporting by Joseph Giannone; Editing by Brian Moss)