US actor Armie Hammer has pulled out of a new film with Jennifer Lopez after what he described as "vicious and spurious online attacks against me".
Hammer had been set to appear in the action comedy Shotgun Wedding.
However, the star's role will now be re-cast after private messages he supposedly sent were circulated online.
In a statement, Hammer dismissed the messages and said the subsequent abuse meant he could no longer spend months away from his children while filming.
'Imminent start date'
The Social Network and Call Me By Your Name actor added that film studio Lionsgate "is supporting me in this and I'm grateful to them for that".
Hammer has two children aged six and three with TV host Elizabeth Chambers. The couple announced their divorce last summer.
His name began trending over the weekend after explicit messages detailing disturbing sexual fantasies, which were purportedly sent by him, appeared online.
A spokesman for Shotgun Wedding told the PA news agency that the film's producers accepted his decision.
"Given the imminent start date of Shotgun Wedding, Armie has requested to step away from the film and we support him in his decision," they said.
Hammer played the Winklevoss twins in 2010's The Social Network and starred opposite Timothée Chalamet in 2017's acclaimed drama Call Me By Your Name. He also appeared alongside Lily James in the Netflix adaptation of Rebecca, which came out last year.