Ms. Ekhtesari, who has won acclaim for poems about Iranian women, and Mr. Mousavi, known for poems on social issues, join a growing list of writers, artists, lawyers and political dissidents who have offended the conservative anti-Western factions believed to control the judiciary, the police, the military and the intelligence services in Iran.

Despite pledges by President Hassan Rouhani of Iran to soften the repressive atmosphere that prevailed before his election in 2013, rights advocates say that in some ways it has worsened, particularly since Mr. Rouhani’s government reached a nuclear agreement with foreign powers including the United States that stands to ease Iran’s international economic isolation.

Many rights activists view the crackdown as part of a struggle within the government, pitting Mr. Rouhani’s desire to open up the country against hard-liners who view such openness as a threat to their power and the tenets of the 1979 Islamic Revolution.

The same tensions appear to be reflected in the espionage prosecution and conviction of Jason Rezaian, the Washington Post’s Tehran correspondent, a dual citizen of the United States and Iran who has been imprisoned since July 2014, and the recent arrest of Siamak Namazi, an Iranian who has advocated improved relations with the United States.

While Ayatollah Khamenei supports the nuclear agreement, his sympathies also lie with the deeply anti-American suspicions shared by the agreement’s opponents in Iran.