Director Lee Daniels attends the Seventh Annual Hamilton Behind the Camera Awards at The Wilshire Ebell Theatre on November 10, 2013 in Los Angeles

Director Lee Daniels attends the Seventh Annual Hamilton Behind the Camera Awards at The Wilshire Ebell Theatre on November 10, 2013 in Los Angeles

*Director Lee Daniels said he decided to come out as gay when he was a teenager in an attempt to upset his abusive father.

The filmmaker has spoken candidly about his troubled relationship with his police officer dad William, who was killed in the line of duty when Daniels was 15.

In a new interview with Out magazine, the 53-year-old reveals the extent of the violence he suffered at the hands of his father, explaining he was regularly beaten for acting effeminately and was even dumped in a trash can when he was caught wearing a pair of his mother’s high heels.

The director admits he told his family the truth about his sexuality to get back at his father.

“When I came out it was because I loathed my dad so much,” Daniels said. “I couldn’t understand how you could, with an extension cord, beat a 45-pound kid just because he’s aware of his femininity.”

However, Daniels insists the trauma he suffered as a child molded his vivid imagination, likening himself to the abused teen in his acclaimed 2009 movie “Precious.”

“For me it really created a world where I understood Precious, where you learn the power of the imagination,” she said.