CLEVELAND, Ohio — A judge in Michigan has ordered the Justice Department and Quicken Loans attempt a settlement in a years-old lawsuit in which the federal government accused the mortgage lending company of fraud.

U.S. District Judge Mark Goldsmith in Detroit wrote in an order Friday that he thought mediation would be prudent because both sides have filed motions for summary judgment, meaning both want the judge to decide part or all of the case in one side’s favor. The judge wrote that both sides are approaching “a period of intense trial preparation.”

A jury trial is scheduled for Aug. 5.

The judge asked both sides to attempt to resolve their case with the help of retired federal Judge Gerald Rosen. Goldsmith stressed “the importance of convening the mediation at the earliest opportunity.”

The Justice Department filed a False Claims Act suit against Quicken Loans in 2015 in Washington, D.C. The lawsuit was later moved to federal court in Detroit, where both sides have aggressively litigated the case over the past few years.

The government said in the lawsuit that Quicken Loans approved loans that should have been denied. It did this by sometimes asking property appraisers to inflate home values after an initial appraisal was too low to get a loan approved, according to the lawsuit.

The lawsuit said that Quicken Loans knowingly violated mortgage underwriting practices just to close bad loans insured by the Federal Housing Administration. It also claimed the company’s senior leadership knew about the issues and that the company’s practices cost taxpayers millions of dollars.

Quicken Loans is led by Dan Gilbert, the company’s chairman who is also majority owner of the Cleveland Cavaliers. Gilbert is expected to be on hand at the Quicken Loans Arena Tuesday to unveil the renaming of the arena to the Rocket Mortgage FieldHouse, sources told cleveland.com.

Rocket Mortgage is a subsidiary of Quicken Loans.

Quicken Loans came out swinging after the suit was filed. The company said in April 2015 that the Justice Department’s lawsuit was "riddled with inaccurate and twisted conclusions from fragments of a handful of emails cherry-picked from 85,000 documents” the government subpoenaed.

Then-CEO Bill Emerson also told The Plain Dealer in 2016 that the company will not settle. Emerson said in the same interview that the company always suspected the government was pushing for a settlement and called the case “a money grab.”

Quicken Loans also filed suit against the Justice Department and the Department of Housing and Urban Development in 2015 to bar the government from using what it characterized as a flawed sample of loans to build a case against the company. A judge dismissed the company’s suit.

Goldsmith put limits on the government’s case in a 2017 ruling. The Justice Department’s lawsuit sought damages for hundreds of loans that Quicken Loans originated between September 2007 and the end of 2011, but Goldsmith limited the case to claims filed after April 2009.