Josh Duhamel is stepping in for Armie Hammer.

The Hollywood Reporter was the first to report that the “Transformers” actor would replace the “Rebbecca” star in Jennifer Lopez-led romantic comedy “Shotgun Wedding”. And now Lionsgate has confirmed the recasting.

“We couldn’t be happier for our bride and groom of this ‘Shotgun Wedding’,” said Erin Westerman, president of production for the Lionsgate Motion Pictures Group. “We know Josh and Jennifer will make a compelling and sexy on-screen couple and they will be fun sparring partners as their dream destination wedding erupts into a memorable nightmare.”

RELATED: Armie Hammer To ‘Step Away’ From ‘Shotgun Wedding’ Role After Social Media Scandal

Jennifer Coolidge and Sonia Braga have also been cast.

“We are also thrilled to bring Jennifer and Sonia on to our cast as Mothers of the Bride and Groom,” Westerman added. “Their acting and comedic talents will add another fun layer to this already-rich action-comedy.”

The casting shakeup comes just weeks after salacious Instagram messages surfaced online. The messages are reportedly from Hammer.

In response to the DMs, Hammer stepped back from the film. “I’m not responding to these bullshit claims but in light of the vicious and spurious online attacks against me, I cannot in good conscience now leave my children for 4 months to shoot a film in the Dominican Republic,” Hammer announced in a statement. “Lionsgate is supporting me in this, and I’m grateful to them for that.”

RELATED: Armie Hammer Apologizes For ‘Foolish Attempt At Humour’ For Calling Lingerie-Clad Woman ‘Miss Cayman’ In Leaked Video

A production spokesperson tells ET Canada, “Given the imminent start date of ‘Shotgun Wedding’, Armie has requested to step away from the film and we support him in his decision.”

“Shotgun Wedding” follows a couple and their families heading to a destination wedding, even as the bride and groom start to get cold feet, but upon their arrival the entire group gets taken hostage.

The film is expected to begin production in February.