New York City's mayor has signed a bill into law making it illegal for employers to ask applicants about their salary history.

Democratic Mayor Bill de Blasio signed the measure Thursday.

The mayor says the new law will help eliminate the gender wage gap by ensuring women with lower paying jobs won't face continued lower salary offers.

The law was authored by the city's public advocate, Letitia James, who says the wage gap costs New York City women $5.8 million in potential earnings every year.

The law goes into effect in 180 days.

Applicants who believe a potential employer violated the law can file a complaint with the city's Human Rights Commission, which can impose penalties of up to $250,000.