The Vatican has written to the Italian government warning that a draft anti-homophobia law could violate the 92-year-old Lateran Treaty governing relations between Rome and the Catholic Church, and restrict religious freedom in Italy.

On Tuesday, Italian daily Corriere della Sera reported that Paul Gallagher, the Vatican’s Secretary for Relations with States, delivered a letter to Rome’s embassy to the Holy See to express concern about the gay rights bill under consideration by the Italian parliament.

The Vatican confirmed it had delivered a letter to Italy’s embassy inside the Holy See last week, but did not comment on its contents. A direct intervention by the Vatican on an issue of Italian law is extremely rare, with diplomatic discussions between the city state and Rome seldom spilling into public view.

The protest is over proposed anti-homophobia legislation — known as the Zan bill, after the centre left lawmaker Alessandro Zan who proposed it. The letter said it would threaten the Church’s “freedom of thought” and expressed fears that religious schools would be forced to participate in a new national day against homophobia.

In 1929, the then Kingdom of Italy signed an agreement with Pope Pius XI known as the Lateran Treaty that recognised the Vatican as an independent state and provided compensation to the Holy See for the loss of the Papal States. The agreement was recognised in the constitution of Italy in 1948.

Italy has existing laws that punishes crimes committed because of discrimination on racial or religious grounds but does not provide specific protection based on sexual orientation, gender and gender identity. Similarly, the Vatican has often condemned discrimination but has also expressed concern about gender theories that blur differences between men and women.

The recognition of gay rights has become a battle ground between Italy’s left and right, with Matteo Salvini, leader of the anti-migration League party, blasting the proposed legislation since it was first tabled last year.

Italy passed a law recognising same sex unions in 2016 under the government of Matteo Renzi, in spite of fierce opposition from the Catholic Church. League senator Roberto Calderoli said at the time that any lawmaker who voted in favour would “go to hell”.

On Tuesday, Salvini said he was willing to discuss the issue with Enrico Letta, leader of the centre left Democratic Party, to “guarantee rights and punish discrimination and violence without giving in to ideologies or censorship, and without invading the field of families and schools”.

A survey published by Eurobarometer last year found that acceptance of LGBT people in Italy was below the European average, with 55 per cent of Italians accepting of a gay, lesbian or bisexual person being prime minister compared with 90 per cent in Sweden and 93 per cent in the Netherlands.