TEHRAN — Just a week after his forces made significant gains in national elections, President Hassan Rouhani of Iran has started a campaign to rescind a news media blackout against a former president, Mohammad Khatami.

Mr. Rouhani’s calculated remarks broke a longstanding taboo and set the stage for a showdown between the president and the country’s hard-line dominated judiciary. The blackout had been in effect for some time before it was publicly acknowledged in February 2015. Since then, press officers for the judiciary have said that other institutions had ordered it, but it is the judiciary that has punished newspapers and websites that defied the ban.

Mr. Rouhani’s comments on Mr. Khatami were for the most part ignored by the Iranian news media. The lone exception was the IRNA, a state-run news agency voicing the opinions of the Iranian government, which highlighted Mr. Rouhani’s remarks on its web page.

Mr. Khatami, a reformist, led the country from 1997 to 2005, winning office twice by overwhelming margins. Under the ban issued by judiciary officials, no Iranian news outlet of any sort is permitted to mention his name or show his photograph.