ANKARA (Reuters) - Turkey should again consider criminalizing adultery, President Tayyip Erdogan said on Tuesday, revisiting an issue that caused outrage among secular Turks and warnings from the European Union when his party raised it more than a decade ago.

FILE PHOTO: Turkey's President Tayyip Erdogan looks on ahead of a meeting at the EU Parliament in Brussels, Belgium October 5, 2015. REUTERS/Francois Lenoir/File Photo

The Islamist-rooted AK Party floated the idea in 2004, two years after it first came to power, as part of a broad overhaul of the Turkish penal code. But the proposal caused a backlash from the secular opposition and EU officials said it could jeopardize Turkey’s efforts to join the union.

While Turkey is still technically a candidate to join the union, its accession talks were frozen in the wake of a widespread crackdown that followed a failed coup in 2016. In return, Erdogan has been angered by what he sees as EU stalling of the bid and has threatened to walk away from the talks.

“I think it would be very, very well-timed to again discuss the adultery issue, as our society is in a different position with regards to moral values,” Erdogan told reporters following a speech in parliament.

“This is a very old issue, far-reaching. It should be discussed. It was already in our legal proposals (in 2004) in the first place. At that time we took a step in accordance with the EU’s demands, but we made a mistake,” he said.

Erdogan’s comment that by meeting EU standards Turkey made a mistake underscores the growing divide between Ankara and Brussels and may not bode well for a coming summit with the bloc in March.

Turkey decriminalized adultery for women in the late 1990s. It had long been legal for men.

Erdogan, who is accused by critics of crushing democratic freedoms with tens of thousands of arrests and a clampdown on the media since the failed coup, has previously spoken of his desire to raise a “pious generation”.

He has spent his career fighting to bring religion back into public life in constitutionally secular Turkey and has cast himself as the liberator of millions of pious Turks whose rights and welfare were neglected by a secular elite.

Last year, the government announced a new school curriculum that excluded Charles Darwin’s theory of evolution, feeding opposition fears that Erdogan was subverting the republic’s secular foundations.

A Reuters investigation last month showed that while students at religious schools make up only 11 percent of the total upper school population, they receive 23 percent of funding, double the spending per pupil at mainstream schools.

While European leaders have robustly criticized Turkey for what they see as rapid backsliding on democracy and human rights, especially the crackdown, Europe still relies on Turkey as a NATO ally on Europe’s southern flank.

Perhaps more immediately, European countries need Turkey to hold up its end of a deal to halt the mass influx of Syrian refugees into the bloc.