France has outlawed buying sex after more than two years of heated debate, passing a law on Wednesday that slaps a €1,500 (£1,210) fine on those who pay for prostitutes while decriminalising the sex workers themselves.

Repeat offenders stand to pay €3,750 (£3,000) and face being sent on compulsory classes to learn of the perils of prostitution.

The new legislation, inspired by a similar 1999 law in Sweden, means France now has one of the toughest laws against sex buyers in Europe, along with Norway and Iceland.

“This is an historic step in the conquest of women’s rights,” said Grégoire Théry, head of Le Mouvement du Nid, which wants to abolish prostitution.

“It’s a revolution in the country of (Dominique) Strauss-Kahn, the Moulin Rouge and the little women of Pigalle (red light district),” he added.

French politicians had for months been at loggerheads over the law; the Left-wing majority in the lower house approved the legislation only to see it twice rejected by the majority Right-wing Senate. But the National Assembly on Wednesday had the final word.

Prostitution is currently legal in France, but in 2003, the conservative government passed a law banning “passive soliciting” by prostitutes on the street.