TEHRAN — The first news report, to a nation usually kept in the dark about military matters, was shocking: 13 Iranian soldiers, all with links to the Islamic Revolutionary Guards Corps, had been killed in an ambush near the Syrian city of Aleppo. What followed this spring may have been even more surprising. Details about the soldiers appeared extensively in the Iranian news media, which not only gave the names of the dead but lionized them with sweeping life stories. Poster-size portraits were plastered all over their hometowns.

For years, Iran covered up its military activities in Syria and Iraq, so the government could deny any official involvement on the ground. Coffins arrived with the bodies of soldiers who went unidentified, referred to only as “defenders of the shrines” of the Shiite saints. When the bodies began to come home in larger numbers, the state news media began calling them “volunteers.”

No longer. Now every Iranian killed in action is named, his picture published, his valor lauded in elaborate tributes in the hard-line news media and on Instagram accounts dedicated to the fighters. The reason for the change, analysts say, is not some newfound dedication to transparency but a rift between the Iranian establishment’s hard-liners, who control the military, and the moderates.