The office of Iran’s president has charged into the middle of one of the most contentious debates over the character of the Islamic Republic, releasing a 3-year-old report showing that nearly half of Iranians wanted an end to the requirement that women cover their heads in public.

The report’s release Sunday comes as dozens of women in recent weeks have protested in public against being forced to wear the veil, a symbol of Iran’s revolution as much as it is deemed a religious requirement.

The decision to release the report — which found that 49.8 percent of Iranians, both women and men, consider the Islamic veil a private matter and think the government should have no say in it — appears to pit President Hassan Rouhani directly against Iran’s hard-line judiciary, which on Friday said that 29 people had been detained in connection with the protests. They have called the demonstrations “childish,” insist that the large majority of Iranians support Islamic veiling and have called for harsher measures against those protesting the veil.

At least as striking as the report’s findings was the timing of its release. The study is from 2014, and publishing it now suggests that the president saw this as a moment to challenge the hard-liners, who hold ultimate power, about such a symbolically potent issue.

“The government wants to show that any crackdown against the veil is illegal and not democratic,” said Fazel Meybodi, a reformist cleric from the city of Qom. “Anyway, crackdowns and punishment are not a part of Islam.”

Rouhani, a moderate compared with Iran’s hard-liners, decades ago prided himself on having been the one responsible for introducing the law on the compulsory Islamic veil. But since his election as president in 2013, and continuing after his re-election last year, he has called for more freedoms for Iranians.

“Mr. President wants to be popular, and his team knows that an increasing number of women do not like the Islamic code of dress,” said Farshad Ghorbanpour, a political analyst close to the government. “They want to woo the women and make sure the popularity of the president does not diminish even further.”

One of the women who protested on the street last week by taking off her scarf, and who requested anonymity out of fear of being arrested, said the report was helpful, but that it did not go far enough. Women are demanding full freedom, the woman said, adding that the report showed that many people agreed with that view.

Thomas Erdbrink is a New York Times writer.