Armie Hammer stepped down from the leading role earlier this month
Jennifer Lopez, Josh Duhamel
Credit: Frazer Harrison/Getty Images

Josh Duhamel has signed on to star in Jennifer Lopez's upcoming action-comedy Shotgun Wedding, a source confirms to PEOPLE.

The actor, 48, replaces Armie Hammer after the Call Me By Your Name star stepped down from the role earlier this month, PEOPLE previously reported.

Shotgun Wedding, which is produced by Lopez and Ryan Reynolds, is scheduled to begin filming on Feb. 22 in the Dominican Republican, the source adds.

Reps from Lopez, Duhamel and Lionsgate did not immediately respond to PEOPLE's requests for comment.

The romantic comedy follows a couple bringing their families together for a destination wedding. But the dream wedding starts to fall apart when they get cold feet once they arrive at the location. Then, the pair are soon forced to come together to rescue their families from a dangerous hostage situation.

Hammer, 34, was previously set to star opposite the "On the Floor" singer, 51, but exited the film after several private messages were leaked by the anonymous social media account House of Effie. The messages, which have not been verified, were alleged to be from the Rebecca actor and described sexual fantasies including BDSM.

"I'm not responding to these bull— 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 said in a previous statement obtained by PEOPLE.

"Lionsgate is supporting me in this and I'm grateful to them for that," Hammer concluded.

Want to get the biggest stories from PEOPLE every weekday? Subscribe to our new podcast, PEOPLE Every Day, to get the essential celebrity, entertainment and human interest news stories Monday through Friday. Get a taste of the podcast below.

A production spokesman previously told PEOPLE, "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 is Duhamel's latest project following his 2020 films The Lost Husband and Think Like a Dog. The father of one made his directorial debut last year with the comedy Buddy Games. He will next star in the upcoming Netflix series Jupiter's Legacy.

Lopez recently produced and starred in the films Hustlers and Second Act. She also executive produced the Freeform series Good Trouble and NBC's World of Dance.