Rainn Wilson overcame his claustrophobia in 'Don't Tell a Soul'.

The 55-year-old actor stars in the new thriller as a security guard who becomes trapped in a well whilst chasing a pair of thieving brothers (Jack Dylan Grazer and Fionn Whitehead) and had to overcome his fears during filming.

Rainn joked: "When they sent me the script, they were like, 'You're gonna spend the entirety of the shoot at the bottom of a hole, how does that sound?' I was like, 'Sign me up.'"

Wilson, who previously starred in 'The Office', admits that it was "tough" during the gruelling shoot.

He told Yahoo! Entertainment: "It was real dirt, and it was real wet. It was tough. It was some hard physical work. It was not a cushy job, like sitting at a desk in 'The Office'. And I'm pretty claustrophobic."

Rainn confessed that the crew used some trickery by constructing an "above ground" well to film him for a greater height and ease his concerns.

He explained: "The camera crew could be on the platform shooting down. And I went into a little hatch, and I crawled in this little hatch, and they'd close the hatch. And then I would get some mud and pack it so you didn't see the door frame."

Rainn continued: "You know how it is when you have those kind of fears. Like you look around and you're really truly at the bottom of a 40-foot hole and you're like, 'I'm in a hole. I'm in a hole. I'm in a ho- Oh, there's a hatch. Right, I'm fine, whew.'

"So I kind of hit that freak-out threshold and then I would be reminded of my real physical circumstances."