When MARK WAHLBERG needs advice on a movie role, he goes right to the top – his priest!

The 38-year-old reformed bad boy relies on his closest confidante and longtime religious mentor, the Rev. James Flavin, to help him pick and choose his parts.

"Mark is a practicing Catholic, and he never makes a final decision on a starring role until Father Flavin gives his OK," an insider revealed to The ENQUIRER. "Mark says he owes his career to Father Flavin."

It was the outspoken priest who urged a reluctant Mark to take the role in The Departed, which earned him an Oscar nomination.

"Father Flavin pushes Mark to honor his religious roots," said the source. "Even though Mark was offered one of the leads in Brokeback Mountain, he passed because of the gay subject matter, which clashes with Catholic doctrine.

"On his priest’s advice, Mark also passed on a lead in Ocean’s Eleven, because he thought the role would typecast Mark."

But the Rev. Flavin doesn’t always pick winners – he urged Mark, against his objections, to take on 2008’s Max Payne, which was a real stinker.

Mark met the pastor when the actor was a 15-year-old Boston street thug, selling drugs, stealing cars and doing hard time in jail for assault. He credits the priest and his probation officers with helping him turn around his life.

"Father Flavin was a HUGE influence in my life," Mark has said.  "He was always trying to sway me to go in the right direction.

"Without him, things might have turned out a lot worse for me."