KABUL, Afghanistan (AP) - The United Nations mission in Afghanistan said Thursday it was deeply concerned by recent arbitrary arrests and detentions by the Taliban of women and girls for allegedly violating dress codes regarding the Islamic headscarf, or hijab.

The mission said it was looking into claims of ill treatment of women and extortion in exchange for their release, and warned that physical violence and detentions were demeaning and dangerous.

The Taliban said last week that female police officers have been taking women into custody for wearing “bad hijab.”

It was the first official confirmation of a crackdown on women who don't follow the dress code imposed by the Taliban since they returned to power in 2021 - a crackdown that has echoed events in neighboring Iran, which saw months of protests in 2022 and has long enforced the mandatory hijab.

The U.N. statement said hijab-enforcing campaigns in the capital Kabul and the province of Daykundi have been ongoing since Jan. 1, with large numbers of women and girls warned and detained. The mission also said women from religious and ethnic minorities appear to be disproportionately impacted by the enforcement campaigns.

“Enforcement measures involving physical violence are especially demeaning and dangerous for Afghan women and girls,” said Roza Otunbayeva, U.N. special envoy and head of the mission.

“Detentions carry an enormous stigma that put Afghan women at even greater risk,” she said. “They also destroy public trust.”

A spokesman for the vice and virtue ministry, Abdul Ghafar Farooq, earlier Thursday rejected reports that women and girls were being arrested or beaten for wearing bad hijabs and called it propaganda from the foreign media. He wasn't immediately available for comment on the U.N. statement.

In May 2022, the Taliban issued a decree calling for women to only show their eyes and recommending they wear the head-to-toe burqa, similar to restrictions during their previous rule of the country between 1996 and 2001.