An imprisoned political activist in Iran who began a hunger strike more than two months ago to protest the incarceration of his wife halted the fast on Tuesday when the judicial authorities released her at least temporarily, rights groups and Iranian news media reported.

The showdown between the authorities and the activist, Arash Sadeghi, who was sentenced in 2015 to at least 15 years for acts deemed seditious, including spreading propaganda, appeared to be a rare instance of compromise by a government not known for leniency.

The release of Mr. Sadeghi’s wife, Golrokh Ebrahimi-Iraee, came a day after an equally rare demonstration on the couple’s behalf by protesters in front of Tehran’s Evin Prison, where both have been held. Videos of the demonstration were spread on Twitter.

The demonstration followed a campaign on social media to support the couple, which became a trending topic internationally despite the heavy restrictions on the use of Twitter and Facebook in Iran.