WASHINGTON (AP) — Baltimore County has agreed to pay $475,000 to settle a workplace discrimination lawsuit brought on behalf of employees who said they were made to undergo overly broad and unnecessary medical examinations that had nothing to do with their jobs.

The settlement, announced Tuesday, resolves a lawsuit from the U.S. Justice Department that accused the county of discrimination and violating the Americans with Disabilities Act. The county has agreed to make payments between $5,000 and $75,000 to 10 workers and job applicants or their surviving family members, but maintains that its policies are legal and crafted to make sure that employees are physically fit to do their jobs.

The suit was brought on behalf of a group of current and former county workers and applicants, including police officers and firefighters. They said they were forced to reveal extensive and private medical histories — including questions about tobacco use, tea and soda drinking habits and past skin rashes — that were irrelevant to their job performance. They also said they were made to undergo fitness-for-duty exams that weren't connected to their jobs, in some cases when they were on medical leave and weren't even preparing to return to work.

Two applicants for EMT positions said they were disqualified because they were diabetic, according to the lawsuit. In one instance, a police officer who injured his neck and shoulder trying to subdue a suspect complained that county forced him to see a doctor who asked him to describe his medical history "from birth," including an eye injury 17 years prior, and reviewed 200 pages of medical records — even though the doctor said he was fine to return to duty.

"The result of the county's discriminatory policies and practices was to force employees, including veteran police officers and firefighters, to submit to invasive and unjustified medical examinations and inquiries," Thomas E. Perez, assistant attorney general for the civil rights division, said in a statement. "The ADA does not tolerate this type of conduct and neither does the Justice Department."

Under the settlement, the county agreed, among other conditions, to not automatically exclude job applicants who are diabetic, to train supervisors on how to comply with the ADA and to conduct medical examinations on existing employees "only where they are job-related and consistent with business necessity."

Baltimore County Attorney Michael Field said in a statement on the county website that although the county was confident its procedures would have been upheld in court, it wanted to avoid a costly legal fight with the federal government.

"In this age of multi-million dollar judgments and soaring attorney's fees, the County must consider the potential cost to taxpayers of litigating against the federal government — an ordeal that would have been lengthy and costly, even if the County ultimately prevailed," Field wrote.

The settlement also includes $30,000 for lawyers' fees, he said.