New York City lawmakers are barring most employers from checking a job candidate's credit record.

The city council passed a bill on Thursday that makes it illegal to request or use a job applicant's credit history in making a hiring decision.

"All New Yorkers deserve the chance to compete for a job based on their skills and qualifications, not three digits on a financial report," said Council Speaker Melissa Mark-Viverito in a statement after the measure was approved by a margin of 47-3. "Just because you've struggled with medical bills or student loans does not make you any less hard working, qualified, or trustworthy than anyone else."

City council member Brad Lander, who sponsored the legislation, said in a press conference that credit checks for employment "unfairly lock" New Yorkers out of jobs.

Get Breaking News Delivered to Your Inbox

Using credit data to screen job hunters has drawn fire from labor and consumer advocates, who say such information is a poor predictor of a worker's performance. The practice also discriminates against low-income people and unfairly penalizes women and victims of domestic violence, critics contend, who note that bad credit often stems from an extended period of unemployment or high levels of medical debt.

"Working people in this city struggle every day to simply make ends meet," said Stuart Appelbaum, president of the Retail, Wholesale and Department Store Union, in an email. "And that struggle often means taking on debt to get by, pay rent, provide for children and pay student loans. Life is tough enough in this town without the additional burden of job discrimination because of credit issues -- issues that really have absolutely nothing to do with future job performance."

A coalition of labor, civil rights and student groups backed the bill, and they cheered the council's passage of the measure.

"New York City is taking a smart and important step in eliminating the use of credit checks in the hiring process, removing what has been an unfair barrier to employment for many New Yorkers," said Christine Owens, executive director of National Employment Law Project, a labor advocacy group, in a statement.

Business groups such as the Society for Human Resources Management and Consumer Data Industry Association have opposed such restrictions, arguing that running a credit check on potential hires helps employers protect themselves against fraud.

However, the legislation does permit employers to use credit checks in certain cases. For example, the police department could review a person's credit history in hiring new officers, and employers could use the checks in considering candidates for jobs that involve cybersecurity or fiduciary duties.