HARRISBURG — The Pennsylvania State Police will pay more than $2 million into a compensation fund and are changing physical fitness standards to settle a lawsuit over how the agency’s trooper-hiring practices ruled out otherwise qualified women.

The U.S. Justice Department announced the proposed settlement Tuesday of litigation that was launched seven years ago, leaving a federal judge in Harrisburg to give her final approval.

The police agency also has agreed to make it a priority to hire as many as 65 women who were affected by the prior fitness standards for entry-level trooper positions.

The Justice Department lawsuit claimed that nearly all male recruits met initial physical readiness tests, but about 30% of women failed. The state police have just over 4,500 sworn members, and 314 are women, the agency said Tuesday.

Communications director Ryan Tarkowski issued a statement saying the Pennsylvania State Police are committed to hiring the most qualified applicants, “with an emphasis on women and minority recruitment.”

The lawsuit said the physical fitness tests that screened out women included standards that were not required to perform a trooper’s job duties.

The Justice Department’s Civil Rights Division argued different pass rates for men and women showed the tests had a disparate impact on women. If women had passed at the same rate as men, about 120 more women would have advanced in the hiring process, and about 45 would have made the force over a 10-year period, the Justice Department lawsuit said.

Under 2003 standards, 55% of women and 88% of men passed. Under 2009 standards, 73% of women and 98% of men passed, the court found.

The pending settlement prohibits the agency from using physical fitness tests that have a disparate impact on women unless they are “job-related and consistent with business necessity.”

The state police tests had included a 300-meter run, a 1.5-mile run, pushups, situps and a vertical jump. In a joint filing Tuesday, the two sides noted the state police developed a new physical fitness test. Tarkowski said it was used for the first time in the academy class that began in January.

Along with cash payments, those who were passed over as a result of the former testing standards and can meet all other hiring requirements will be invited to become cadets. Those who meet specific criteria and graduate from the state police academy in Hershey will be granted retroactive seniority for pay and vacation accrual.

When the lawsuit was filed, the state police commissioner at the time claimed that lowering standards would endanger safety and insult those who had already met them.

“We will not be bullied into changing and lowering our standards by the Department of Justice or anybody else,” former Commissioner Frank Noonan said in 2014.