Shia LaBeouf was nearly cast in the Oscar-winning film “Call Me By Your Name”.

According to screenwriter James Ivory, who wrote about the almost casting in his new memoir, Solid Ivory, LaBeouf had been contacted for the part of Oliver, despite being “doubtful” the actor was the right choice. GQ shared an excerpt of the upcoming novel.

READ MORE: Margaret Qualley On FKA Twigs’ Allegations Against Shia LaBeouf: ‘I Believe Her’

Ivory says producers then flew LaBeouf to read with Timothée Chalamet, who plays Elio in the film. The part of Oliver ultimately went to Armie Hammer.

“The reading by the two young actors had been sensational; they made a very convincing hot couple,” Ivory wrote.

LaBeouf was ultimately dropped from consideration due to what Ivory described as “bad publicity” at the time. Around the time of filming in 2015, LaBeouf had a number of public incidents including being arrested for public intoxication. In early 2017 he was allegedly arrested again during a protest of Donald Trump’s Inauguration.

The “Transformers” alum was also sued by ex-girlfriend FKA twigs last year for alleged physical, mental, and emotional abuse.

READ MORE: Christy Carlson Romano Explains Why She Doesn’t Talk To Shia LaBeouf Anymore

Hammer has also found himself in hot water after being accused of sexual assault last year.

“Call Me By Your Name” was released in 2017 and later earned four Oscar nominations, including Best Performance by an Actor in a Leading Role for Chalamet. Ivory took home an Academy Award for Best Adapted Screenplay.