The offence will be punishable by up to six years in jail, and fines of up to €15,000.

The proposal was put forward by Silvio Berlusconi’s Forza Italia (FI) party and is part of a reform bill dubbed “Code Red”, which aims to give greater protection to victims of violence and stalking.

The vote was unanimous after gaining support from the centre-left Democratic Party (PD). 

Italy’s ruling far-right League party and the anti-establishment Five Star Movement (M5S) had largely rejected the revenge porn proposal last week.

The decision sparked anger in the assembly and the discussion of the text had to be postponed after opposition members both from the left and right staged a protest.

Discussions recommenced on Tuesday and the amendments were eventually approved by all political sides.

“Reason has won. If we voted yes today, it was solely thanks to the protest of opposition parties,” FI lawmaker Mara Carfagna said.