Josh Hartnett turned his back on big-budget movies and kept "Hollywood at bay" for the sake of his mental health.

Once dubbed "the next Leonardo DiCaprio," Hartnett said he walked away from tinsel town so that he can have a "good home life."

"It was the best thing for my mental health and my career to keep Hollywood at bay... Luckily, I think I hit onto it early on in my life," he told Australia's breakfast show "Sunrise" on Wednesday. "It's about creating a good home life and being able to do things that are wild and wonderful like making films, which is such a privilege."

Hartnett was hugely popular in the early 2000s. He is best known for his roles in the 2001 flick, "Pearl Harbor," and "40 Days and 40 Nights" in 2002.

But the actor chose to turn to a different direction because Hollywood was taking a toll on his personal life.

"I was on the cover of every magazine," he said in an interview in May 2014, US Weekly reported. "I couldn't really go anywhere. I didn't feel comfortable in my own skin. I was alone. I didn't trust anyone."

He also acknowledged the benefits of stardom at the height of his career. "I still get offered film and TV roles, luckily, but years ago, if I saw a role I wanted, there was a good chance I could grab it," the "Black Hawk Down" actor said.

"When I see a role now, I've got to fight for it. It's not bad. It's actually more rewarding. Depressing when something doesn't go your way, but only for a minute," he added.

The 43-year-old actor also regrets not accepting a few roles in the past, including two superhero roles. But his biggest regret was pulling out of a role opposite Jake Gyllenhaal in Academy Award-winning film "Brokeback Mountain," which eventually went to late Health Ledger.

"Unfortunately, I was going to do 'Brokeback Mountain,' and I had a contract with [2006 film] 'Black Dahlia' that I had to film, so I had to drop out of it," he told news.com.au during an interview Wednesday to mark the release of his latest movie "Ida Red."

"I've always wanted to kiss Joaquin, so that's my biggest regret," he joked.

Tamsin Egerton Josh Hartnett
"Black Hawk Down" star Josh Hartnett is expecting a baby with girlfriend Tamsin Egerton. Getty Images/Elisabetta Villa