Shia LaBeouf sleeps with a gun.

The 31-year-old actor claims to have been diagnosed with post-traumatic stress disorder (PTSD), which stems from hearing his mother being sexually assaulted when he was younger, and he believes that witnessing the violence against his mom triggered a lot of his own erratic behaviour.

He recalled: ''I froze. The man ran out, and my mom ran after him. [A friend] came running over. I remember he had a crossbow...

''When I got to rehab last year, they said I had PTSD...

''The first time I got arrested with a real charge, it stemmed from the same s**t. Some guy bumped into my mother's car with his car in a parking lot, and my head went right to 'You need to avenge your mother!' So I went after the dude with a knife.''

The 'Nymphomaniac' star - who didn't use the knife - bought a gun as soon as he was able to and keeps it by his bed.

He told the new issue of Esquire magazine: ''I've always thought somebody was coming in. My whole life.''

Shia was arrested for disorderly conduct and public drunkenness at a hotel in Georgia last July after he repeatedly swore at arresting officers and has admitted he ''f***ed up'' and is ''mortified'' by his behaviour.

He said: ''What went on in Georgia was mortifying. White privilege and desperation and disaster... It came from a place of self-centered delusion...

''It was me trying to absolve myself of guilt for getting arrested...I f***ed up.''

And the 'Transformers' actor - who was ejected from a theatre in 2014 for drunken behaviour - admitted his past antics have come back to haunt him as he's struggling to land work now.

He told the new issue of Esquire magazine: ''I'm run out. No one's giving me a shot right now. Spike Lee is making a movie. I was talking to him about it.

''He goes to the money and pushes to try to get me in the movie, the money says no, and that's the end of me hanging out with Spike Lee for this film.''