ISTANBUL — President Recep Tayyip Erdogan issued a surprise decree early Saturday withdrawing Turkey from a landmark European treaty that women's rights groups said had played a critical role in protecting Turkish women from gender-based violence.

The treaty, the Istanbul Convention, sought in part to ensure equal legal protections against abuse for women across Europe. Turkey was the first country to sign the convention, in 2011, when Erdogan was prime minister. But some conservative Muslims who form a critical bloc of support for the Turkish leader had criticized the treaty from the start, framing it as part of a Western plot aimed at harming the country’s traditional notions of family and encouraging divorce.

In recent years, Erdogan and other members of his ruling party have joined the calls to torpedo the agreement, citing a threat to conservative mores. “We will not leave room for a handful of deviants who try to turn the debate into a tool of hostility to our values,” Erdogan told members of his party during a speech in Ankara in August.

Erdogan’s midnight decree was met with outrage by women’s groups and sparked demonstrations later Saturday in Istanbul and other Turkish cities. The decision threatened to further alienate Ankara from its Western allies, including the United States, which has recently chastised Turkey for anti-LGBTQ rhetoric and last week condemned Turkish actions aimed at dissolving the country’s third-largest opposition party as undemocratic.

President Biden on Sunday harshly criticized the decision by Turkey, a NATO ally, calling the withdrawal “sudden and unwarranted” and “deeply disappointing.”

“Countries should be working to strengthen and renew their commitments to ending violence against women, not rejecting international treaties designed to protect women and hold abusers accountable,” Biden said in a statement. He made reference to the killings in Georgia last week of eight people, including seven women, six of Asian descent. Turkey’s decision, he said, was “a disheartening step backward for the international movement to end violence against women globally.”

The Council of Europe called news of Turkey’s withdrawal from the convention “devastating.”

“The Istanbul Convention covers 34 European countries and is widely regarded as the gold standard in international efforts to protect women and girls from the violence that they face every day in our societies,” the council said in a statement.

“This move is a huge setback to these efforts and all the more deplorable because it compromises the protection of women in Turkey, across Europe and beyond.”

In a separate decree early Saturday, Erdogan fired the governor of Turkey’s central bank just months after his appointment and days after he sharply hiked interest rates in a bid to curb high inflation. The governor, Naci Agbal, was the third central bank governor to be fired in less than two years.

At least two recent polls had shown that a majority of the Turkish public opposed withdrawing from the Istanbul Convention. But analysts say that Erdogan, whose popularity has recently waned, is far more concerned with energizing narrow portions of the electorate as he looks to reelection.

“What a difficult position the AKP government is in that they are giving their attention to a very small fraction of society and putting the lives of millions of women at risk,” Fidan Ataselim, the secretary general of the We Will Stop Femicide movement, said in a video posted on social media, using the initials of Erdogan’s ruling Justice and Development Party.

“You cannot ignore millions of women,” she said. “You cannot confine millions of women into homes. You cannot erase millions of women from the streets and squares.”

Women’s rights groups have long complained that Turkey has failed to fully implement the provisions of the Istanbul Convention, saying it was undermined by a judiciary reluctant to punish men for abuse and by Erdogan’s Islamist government, which has sought to relegate women to traditional social roles.

At the same time, rates of domestic violence and femicide have risen. More than 400 women were killed by male partners last year, and so far in 2021, 78 women have been killed, according to We Will Stop Femicide. The killings and other violent attacks — captured on video and widely disseminated on social media — have shocked Turkey and galvanized women’s groups.

Among the recent attacks: A woman named Reyhan Korkmaz, who had obtained a restraining order against her husband after previous violent incidents, was reportedly killed by her husband in front of the couple’s four children on March 7 in Ankara, according to local media, who said her throat was slit.

On March 13, Husna, a 30-year-old mother of three children, was killed after her husband shot her five times in Turkey’s coastal province of Izmir, local media outlets reported.