Job seekers in New York City can now rest assured that their credit history won't impact their employment prospects.

The New York City Council passed legislation that bans most employers from discriminating against job applicants and current workers based on credit history.

The bill passed Thursday by a vote of 47-3 and is being dubbed the strictest in the country.

The bill's sponsor, Brad Lander, said credit checks can be discriminatory and don't relate to job performance.

"Millions of Americans who have bad credit, would also be great employees," he said. "What they need to repair their credit is a job, and to make it harder for them to get a job is the definition of unfair."

"This is a civil rights bill," said Lander.

The legislation now heads to the mayor's office and Lander said he is "optimistic" it will get a signature. The law would go into effect 120 days after it's signed.

Related: Background checks: What employers can find out about you

There are some exemptions to the New York City bill: Employers can still run credit checks for jobs of "public trust," according to the law, including police officers and some high-level city workers. Credit checks can also be used for positions that involve possible cyber security risks or fiduciary duties to the employer.

Employers can still run credit checks for positions where it's required by federal or state laws, like mortgage bankers and securities broker-dealers, Lander said.

According to a 2012 survey from the Society for Human Resource Management (SHRM), 47% of employers in the U.S. run credit background checks on potential hires.

Mike Aitken, vice president of government affairs at SHRM, said employers are being more selective when it comes to running credit checks because they are so costly.

"Overwhelmingly, it's done at the end of the process and focuses on the finalist or group of finalists."

Related: How to explain that gap in your resume

Federal law requires employers to get permission from candidates to get a background report, which can include a credit check.

"It is really an effective practice to use; the goal is to try and protect the employer from a fiduciary standpoint and the customers," Aitken said, but cautioned against "blanket use."

Several states and cities have passed similar legislation, including Nevada, California and Maryland.