TEHRAN -- On the eve of a visit by Iran's moderate president, Hassan Rouhani, to the United States, the Iranian authorities on Wednesday unexpectedly freed 11 of Iran's most prominent political prisoners, including Nasrin Sotoudeh, a human rights lawyer.
Analysts said the prisoner release was a significant step in Mr. Rouhani's efforts to repair Iran's relationship with the West, mired in a dispute over Iran's nuclear program and criticism of its human rights policies. His visit to New York to attend the annual session of the United Nations General Assembly is part of a diplomatic offensive he began after his election in June.
Ms. Sotoudeh was serving six years in prison for endangering national security and misusing her profession as a lawyer. In a telephone interview after her release, she said: "I don't know why they released me. I don't know under what legal basis they released me. But I am free."
Her husband, Reza Khandan, said: "I just drove her home. My wife is freed."
Of the prisoners freed on Wednesday, eight are women and three are men. They include a journalist, Mahsa Amrabadi, whose husband and fellow journalist, Masoud Bastani, remains in prison. Some of them were taking part in Iran's prison leave system, in which some prisoners are allowed to live at home but remain under the threat of imprisonment if they cross the authorities. But dozens of people remain in prison, especially those who have been sentenced for their roles in an antigovernment protest after the disputed 2009 election results.
Mr. Rouhani is scheduled to speak next Tuesday before the General Assembly, where he is expected to portray an Iran ready to engage with the West.
Analysts said the prisoner release could soften some of the criticisms over Iran's human rights policies and allow for Mr. Rouhani to focus on finding a diplomatic solution to the standoff over Iran's disputed nuclear program.
"Clearly these releases are related to Mr. Rouhani's trip to New York," said Farshad Ghorbanpour, a political analyst close to the new president. "Iran wants to make a good impression on the eve of his trip."
The release of Ms. Sotoudeh, 50, is especially significant. For a long time, she was the only lawyer in Iran taking on high-profile cases, defending children, activists and minorities. Unlike some activists, Ms. Sotoudeh never chose to leave Iran, despite constant pressure on her by Iran's intelligence services, which arrested her in 2010. In addition to her jail sentence, she had been banned from practicing law for 20 years; it was unclear Wednesday whether the ban had been lifted.
In his annual message for Iranian New Year in 2011, President Obama specifically singled out Ms. Sotoudeh. "We have seen Nasrin Sotoudeh jailed for defending human rights," he said.
Iranian officials deny that there are any political prisoners in Iran, saying that all those behind bars have been tried according to the country's laws.
While in Tehran's notorious Evin prison, Ms. Sotoudeh went on two long hunger strikes after her 12-year-old daughter was denied permission to travel outside the country. In 2012, the European Union awarded her the Sakharov Prize for Freedom of Thought.
Among the other prisoners released on Wednesday was former Commerce Minister Feizollah Arabsorkhi, a member of a reformist political party declared illegal after the 2009 antigovernment protests, which were triggered by President Mahmoud Ahmadinejad's disputed re-election victory.
Mr. Arabsorkhi was in a hospital in Tehran undergoing a shoulder operation when he heard that he had been officially freed, his wife, Maryam Sharbatqods, said over the phone. "Rouhani's election victory has forced the authorities to release the political prisoners," Ms. Sharbatqods said.
Two presidential candidates in 2009 -- former Prime Minister Mir Hussein Mousavi and Mehdi Karroubi, a former Parliament speaker -- have been under house arrest since 2011, along with Mr. Mousavi's wife, Zahra Rahnavard. During his election campaign, Mr. Rouhani said he would work to secure their release.
Mehdi, 27, a university student who took part in the 2009 protests and asked that his surname not be published, said: "Today's prisoner releases show that there are negotiations going on regarding their freedom. Maybe it will take some time to get them freed from house arrest. I am much more hopeful now."
An imprisoned American of Iranian descent, Amir Hekmati, was not among those freed on Wednesday. Mr. Hekmati, 30, a former Marine, was arrested more than two years ago on espionage charges during what his family called an innocent visit to his grandmother. Mr. Hekmati's family, who is from Flint, Mich., has been publicly pleading for his release, and American officials, including Secretary of State John Kerry, have been calling on Mr. Rouhani's government to let Mr. Hekmati go home.
On Tuesday, Mr. Hekmati's congressman, Daniel T. Kildee, sent a letter to Samantha Power, the new American ambassador to the United Nations, urging her to press the issue when Mr. Rouhani visits for the General Assembly session next week.
Rick Gladstone contributed reporting from New York.
This article originally appeared in The New York Times.