Cairo: Captain Amr Salah was among 16 Egyptian policemen, killed last week in clashes with terrorists in a desert area.
He also appeared as a member of an anti-terror squad in the film, “The Cell”, an Egyptian thriller being played at local theatres.
The film, starring Egypt’s prominent actor Ahmad Ezz, has been a box office hit since it was released for public showing last month.
In real life, Salah was a member of the Special Operations, Egypt’s elite anti-terror security service.
His death has shocked the film’s makers. Tributes have poured in for the young officer.
“I am devastated,” actor Ezz said.
“My heart aches for him. May God have mercy on him,” Ezz wrote on his Facebook page where he declared three days of mourning for Salah and other slain policemen.
Egyptian authorities said the officers were killed on Friday during a firefight that lasted hours following a security raid on a militant hideout in the western desert.
There has been no claim of responsibility for the incident, although some media suggested involvement of militants sneaking into Egypt from neighbouring Libya.
Images and footage of Captain Salah in the “Cell” have been carried by Egyptian print and television stations over the past few days.
Tarik Al Eryan, who directed the “Cell”, paid homage to Salah.
“The martyr and his brave colleagues were among us a few months ago,” said Al Eryan.
“He worked with us in the film that highlights the mission of him and his colleagues, who really sacrifice their lives for the sake of this country,” he added in an online statement.
Egypt has experienced a string of militant attacks mainly against security forces since the army’s 2013 toppling of Islamist president Mohammad Mursi following enormous protests against his rule.
Most attacks were claimed by the terrorist Daesh group.