Videos that showed apparently coerced confessions of the prisoners — interwoven with ominous-sounding music and clips of unrelated assaults by militants of the Islamic State — have been shown on Iranian state television in the months since the executions.

Produced and disseminated by official media outlets, the videos contain no apologies for the mass hangings. They apparently are meant to exploit fears among the country’s majority Shiite population about the Islamic State, the Sunni extremist group ensconced in Syria and Iraq that shares antipathy for both Iran and the West.

Human rights groups say the hangings in Iran on Aug. 2 put 20 to 25 prisoners to death, one of the largest mass executions ever carried out in that country.

In a report about the videos issued Wednesday, titled “Broadcasting Injustice, Boasting of Mass Killing,” the rights group Amnesty International accused Iran of having used stage-managed confessions, falsehoods and sensationalist screen titles like “In the Devil’s Hands” and “In the Depth of Darkness” to justify the mass hangings to a domestic audience.

In some cases, the rights group said, the confessions covered crimes committed well after the condemned had been incarcerated.

“By parading death row prisoners on national TV, the authorities are blatantly attempting to convince the public of their ‘guilt,’ but they cannot mask the disturbing truth that the executed men were convicted of vague and broadly defined offenses and sentenced to death after grossly unfair trials,” said Philip Luther, Amnesty International’s research and advocacy director for the Middle East and North Africa.

Since the 1979 Islamic revolution, Iran has been among the world’s leaders in administering the death penalty, and has applied it for a wide range of crimes beyond homicide. Many of the executed have been convicted of drug offenses or on the more vaguely defined charge of enmity against God.

Use of the death penalty in the region is not limited to Iran. Saudi Arabia and Iraq, for example, also have been singled out by Amnesty International and other human rights groups.

While these groups have long accused the judicial authorities in Iran of using torture and other coercive methods against suspects, the use of recorded confessions in sophisticated videos shown on national television is relatively new.

“It seems Iran has joined the region’s propaganda industry, producing slick videos featuring the apparently forced confessions of men they later executed as ‘terrorists,’ bizarrely interspersed with scary videos of Islamic State attacks they had nothing to do with,” wrote Sarah Leah Whitson, the Middle East director at Human Rights Watch, in an emailed reaction to the Amnesty International report.

The men confessed to membership in an outlawed Sunni extremist group known as Tohid and Jihad, which they said carried out attacks and plotted assassinations. In some of the videos, they compared themselves to the Islamic State and said they “would have committed atrocities worse than IS if we had not been stopped.”

The Amnesty International report uncovered what it described as several inconsistencies in the videos, suggesting the confessions had been scripted. “In some cases, the men are linked to crimes that occurred months after they had been arrested or the nature of their involvement in the crimes attributed to them change massively from one video to another,” the report said.

There was no immediate response to the Amnesty International report from Iranian officials. While they have often ignored criticism from Amnesty International and other rights groups, they are not immune to it.

In 2013, Iranian judges were given the discretion to impose alternative penalties on juveniles convicted of capital offenses. Precisely how judges have used this discretion remains unclear, but the change was seen as a response to criticism of Iran for putting some children on death row.

“The Iranian government is sensitive to global public concern,” said Sunjeev Bery, the advocacy director for the Middle East and North Africa at Amnesty International’s Washington office.

“Like many governments, Iranian officials may attempt to portray themselves as impervious to international criticism,” Mr. Bery said, “but it can lead to many costs.”

A version of this article appears in print on November 17, 2016, on Page A8 of the New York edition with the headline: Rights Groups Assail Iran Over Videos of Prisoners Before Hanging. Order Reprints|Today's Paper|Subscribe