Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Sometimes gender discrimination can follow you from one job to the next.

That's the reasoning behind a bill proposed in Congress on Tuesday that would ban employers from asking a job-seeker's previous salary.

The federal legislation is intended to help close the gap in women's and men's earnings by ensuring that women aren't trapped in a cycle of lower pay as they move from job to job.

And the 2017 Pay Equity for All Act comes just days after California's 9th Circuit Court of Appeals ruled that basing a woman's salary on her previous job is not discrimination.

On Thursday, the San Francisco-based federal court overturned a lower-court ruling that said wage gaps based on previous salary histories were discriminatory. Mathematics instructor Aileen Rizo had filed the lawsuit in 2013 after discovering that a brand-new male hire with less experience and education was making $13,000 more than she was in her fourth year on the job.

A woman holds a sign reading, 'Equal Pay,' as she joins with others during 'A Day Without A Woman' demonstration on March 8, 2017 in Miami. Joe Raedle / Getty Images file

The Morning Rundown Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Rizo's attorney, Dan Siegel, told NBC News, "Relying on salary history in the historical context of women making 80 cents for each dollar made by men simply perpetuates gender discrimination and is tantamount to basing compensation on gender."

"When you see injustice, you have to make a change," Rizo told the San Francisco Chronicle last month. "I don’t want the end of the road for my daughters to be sitting next to a man who makes more than they do just because of the figure he was making at a past job."

In a 2015 decision, U.S. Magistrate Judge Michael Seng ruled in Rizo's favor, saying that women's salaries earlier in their careers are likely to be lower than male counterparts because of gender bias. But the 9th Circuit sent the case back to Seng, citing a case from 1982 that said employers can use previous salary information as long as it's applied reasonably.

Rep. Eleanor Holmes Norton, D-D.C., introduced the federal ban on salary history questions Tuesday, saying the California court's ruling illustrated why a federal law is needed.

Del. Eleanor Holmes Norton speaks on Capitol Hill in Washington on June 15, 2016. Lauren Victoria Burke / AP file

"After last week’s disappointing 9th Circuit ruling," Norton said, "It is critical that Congress take legislative action to ban the practice of asking for an employee’s salary history, which disadvantages women and minorities, who disproportionately carry lower salaries through their entire careers simply because of wages at previous jobs that were set unfairly."

The Pay Equity for All Act would also bar employers from basing wages or salary on previous benefits, or firing an employee who complains about being asked salary history questions. It would also fine companies who violate the law as well as allow employees or job seekers to sue for up to $10,000.

"Our bill will help reduce the wage gap by requiring employers to offer salaries to prospective employees based on merit, not gender, race, or ethnicity," said Norton.

Asking for the salary history of a prospective employee is banned in Massachusetts, along with the cities of D.C. and Philadelphia, and New York City banned prior salary questions last month.

But in most of the country, it's perfectly legal for an employer to base a new hire's salary on what they made at their last job — even if they were being severely underpaid.

New York City Public Advocate Letitia James, who introduced the city's ban and lobbied for it on Equal Pay Day, told NBC News that asking a job applicant for their last salary "perpetuates gender wage discrimination."

"The 9th Circuit’s decision essentially condones the practice of paying men more than women despite performing the same work," said James. "This is a huge setback not only for achieving gender parity, but for our entire economy."