Italian Interior Minister Angelino Alfano speaks at a press conference during an informal meeting on Justice and Home Affairs in Milan, Italy Tuesday, July 8, 2014, part of a two-day meeting of the EU Interior Ministers on immigration, gender-based violence and personal data protection under the Italian Presidency semester of the European Union. (AP Photo/Luca Bruno)

ROME, Oct 8 (Reuters) - Italy's interior minister has ordered mayors to stop recognizing the validity of gay marriages performed outside the country, prompting protests from rights groups and local officials.

Gay marriage is illegal in Italy. But some Italian cities have allowed gay couples who legally wed in other countries to register their unions in city halls when they return, just as heterosexual couples who marry outside Italy can do.

The recognition is significant because it can help a partner inherit the other's estate and affects health benefits, insurance and pensions.

Minister Angelino Alfano, who sent his directive to mayors on Tuesday night, rejected accusations of homophobia made by some gay rights advocates.

"This is not ideological. My only intention is to see that the law that does not allow two persons of the same sex to marry is respected," he said.

A poll taken last year showed that gay marriage was supported by just a quarter of the population in Italy, where the Roman Catholic Church holds considerable sway over politics.

The same survey showed more than 85 percent backed the recognition of so-called "civil unions" to give same-sex partners more rights.

Last April a judge in the Tuscan city of Grosseto ruled in favor of a gay couple that wanted their marriage, performed in the United States, to be transcribed in the records of the city after their request had been refused.

City officials in Naples said they would go to court to challenge Alfano's directive.

Flavio Romani, head of Italy's leading gay rights group, Arcigay, called Alfano's directive "irresponsible."

Michela Brambilla, a parliamentarian of the opposition center-right Forza Italia headed by former Prime Minister Silvio Berlusconi, accused the government of being "out of touch with the country." (Reporting by Philip Pullella; Editing by Andrew Heavens)