France parliament has approved legislation that makes sexual harassment a crime, addressing problems many say have existed for decades in the country.

The new law sets three levels of harassment, with the most serious – in cases where the harasser has authority over the victim, the victim is younger than 15 years old, or multiple people carry out the harassment – punishable by up to three years in prison.

The National Assembly passed the law after the Senate voted earlier in the day.

Its passage comes more than two months after a court struck down the previous statute, saying it was too vague and failed to protect women.

The legislation covers offences in universities, the housing market and job interviews.

Single acts of sexual blackmail will be considered sexual harassment, whereas previously only repeated acts were.