Starting in 2018, it will be illegal in Massachusetts for an employer to force prospective employees to divulge how much they were making at their last job.

It's part of a sweeping new equal pay law signed by Gov. Charlie Baker Monday.

Massachusetts becomes the first state to forbid employers from asking job applicants how much they made at their previous jobs. The goal is to prevent women from being stuck in a cycle of low salaries.

"Because what happens to people over time is if in that first negotiation or those first few jobs out of high school or college you are underpaid, then you really get a snowball effect where if each subsequent salary is really benchmarked to that, then what can happen is that type of usually implicit and occasionally explicit discrimination really then follows that person throughout their career," said Victoria Budson, who directs the Women and Public Policy Program at Harvard University's Kennedy School of Government and who pushed for passage of the law.

The law's chief sponsor, Democratic state Sen. Pat Jehlen of Somerville, added that divulging a low salary can even prevent an applicant from getting a job.

"We heard about a woman," Jehlen recalled, "who had had a phone interview for a job, did very well, and didn't hang up at the end of the conference call, and heard the other people saying, 'She looked like an ideal candidate until we heard what she's making now. She must not be as good as she looks,' and they didn't hire her."

Another notable provision in the new equal pay law is that it protects employees from retribution if they talk openly about how much they're paid. Only a dozen or so states do that.

Dorothy Simonelli smiles as Lt. Gov. Karen Polito shakes her hand during the bill-signing ceremony Monday. Simonelli fought for equal pay as a cafeteria worker in the late 1980s in Everett. (Elise Amendola/AP)

One business group opposed the new law: the Massachusetts High Technology Council. It objected to the presumption that pay differential is the result of discrimination. The group declined to comment for this story.

Other business groups supported the law. One reason: It contains a new, first-in-the-nation provision that could help companies. If a company is sued for wage discrimination, it can defend itself by showing that it has taken a look at its pay practices and taken steps to remedy any differences.

To Jehlen, that's the most powerful part of the new law.

"Because I think most discrimination is not intentional," she said. "I think people are unaware of bias or of the causes of bias, and so if they perform a genuine self-assessment looking across the board at what different people are paid, and seeing if there is unintentional differentials, they can use that if somebody tries to bring a suit against them."

Some see the Massachusetts law as part of a larger trend across the country.

"It's actually the latest in a run of some pretty strong pay equity laws that have passed over the last year or so in California, in New York, recently in Maryland," said Vicky Shabo, who tracks pay equity for the National Partnership for Women and Families.

The states are taking the lead at a time when Congress has been unable to pass an equal pay bill.