Employers have welcomed a European Court of Justice ruling which they say will allow companies to continue to reward workers for long service.
Childcare and maternity leave may mean women get less pay
The court rejected an appeal by health and safety inspector Bernadette Cadman that it was wrong to pay more to male staff who had been in the post longer.
Ms Cadman said that because women were more likely to have breaks from work, this amounted to sex discrimination.
But the court has left leeway to appeal in certain individual circumstances.
However in its general ruling the court said experience was an acceptable way of setting somebody's pay.
Ms Cadman, 44, from Manchester, had won her employment tribunal five years ago after discovering she was earning up to £9,000 less than men in the same post.
She said the pay policy discriminated against women as they were more likely to have less experience as a result of taking breaks for maternity leave and childcare responsibilities.
Her victory was referred to the Court of Appeal and was then sent to the European court.
The European court said employers did not have to justify paying longer-serving male workers more than female employees for doing the same work, because experience "enables the worker to perform his duties better".
The only exception was if "the worker provides evidence capable of raising serious doubts in that regard".
The case will now go back to the Court of Appeal.
The CBI business group said that experience was a "critical" way for employees to set their salary schemes.
Ms Cadman told the Guardian newspaper that the case was "about recognition that women should not be paid less than their male counterparts".
The president of the European Women Lawyers' Association, Leena Linnainmaa, said that the situation could only be more equal if men were encouraged to take paternity leave.
"The fact that women take maternity leave is a great burden on their careers," she told the Times.