It is a symbolic scene in the movie “Black Mass,” which opened in theaters today: Johnny Depp, portraying South Boston gangster James “Whitey” Bulger, slips into an empty church, perhaps seeking absolution before he flees the city he terrorized for decades and begins his new life as a fugitive.

The scene is fictitious, “Hollywood heresy,” according to former federal prosecutor Brian T. Kelly, who helped send 86-year-old Bulger to prison for life for participating in 11 murders while running a sprawling criminal enterprise and working as an FBI informant.

And yet, there is a thread of religion running through Bulger’s life.

Much has been written about his life as a merciless killer and his long stint on the FBI’s 10 Most Wanted list before his capture in Santa Monica, Calif. four years ago. But little has been reported about his faith, or lack thereof. The fact is, Whitey Bulger was raised Catholic and made references to it throughout his life.

“Many religious people out there want to save my soul and get me to heaven,” Bulger wrote to an acquaintance from jail several weeks after his 2013 conviction in Boston. He confided that he’d received Bibles, prayer cards, and letters offering “suggestions” from kind strangers across the United States and in Ireland.

“All well-meaning people but I’m not one for organized religious message – haven’t done much to stop war or crime,” the gangster wrote in the letter. (Then again, consider the source.)

A woman who gave birth to Bulger’s only known child in 1967 said he had urged her to have an abortion when he learned she was pregnant, but supported her when she refused. The woman, Lindsey Cyr, described Bulger as a warm and attentive father to their son, Douglas, and said he was devastated when the boy died at age six from Reye’s Syndrome, a severe reaction to aspirin.

Bulger was one of six children raised in Boston by devoutly Catholic parents. He received the sacraments, and declared himself Catholic on federal prison forms while serving nine years in the 1950s and 1960s for bank robberies in Massachusetts, Rhode Island, and Indiana.

As a boy, Bulger attended Catholic elementary school for four years before transferring to public school. His nuns and teachers described him as “surly, lazy and generally disinterested in school activities.”

Yet the nuns managed to teach him perfect penmanship. Even now, as an octogenarian writing from a federal penitentiary in Florida, Bulger’s dispatches are penned in perfectly slanted cursive, spaced evenly on lined paper.

When Bulger was eight years old, in 1938, his family moved into the Old Harbor Village project in South Boston, which was the first public housing development in New England. His mother was very active in their South Boston parish, St. Monica’s, where Bulger’s younger brother, Bill, served as an altar boy — a precursor to an illustrious career as president of the Massachusetts Senate and subsequently the University of Massachusetts.

By the time he was a teenager, Bulger was hanging around with a rough crowd, and his mother lamented that if only he had gotten involved in activities organized at St. Monica’s, he might have been influenced by a local priest who was known for setting rebellious youths on the right path.

Instead, Bulger began fraternizing with a group of ex-convicts who convinced him that they could make easy cash by robbing banks at gunpoint. When Bulger, then 26, was arrested and facing a lengthy prison term, he suddenly found religion.

He sought guidance from the Rev. Robert Drinan, a Jesuit priest and family friend whom his brother Bill had met while attending Boston College. Drinan would later serve as a US congressman from Massachusetts.

Two days after Bulger was sentenced to 20 years in prison, while locked up at a local jail while awaiting transfer to a federal penitentiary, he wrote to Drinan, congratulating him on his recent appointment as dean of Boston College Law School and thanking him for visiting him recently.

“I thank you from the bottom of my heart for all the help you have given me,” wrote Bulger, adding that he was relieved that he would be released some day. “These years will be put to good use.”

Drinan served as Bulger’s advisor while he was in prison and as his sponsor when he was granted parole in 1965 after he had served nine years. And he was not the only priest to forge a bond with the gangster.

Bulger was allowed to correspond with only 10 people on a pre-approved list while incarcerated and made room for several priests on the list, along with relatives. And though he had few visitors while behind bars, a nun and a priest who were childhood friends from South Boston were among them.

Despite Bulger’s promise to reinvent himself while in prison, he was transferred from an Atlanta penitentiary to Alcatraz in 1959 for slipping a hacksaw blade to several inmates who were plotting to escape.

After he arrived at the prison dubbed “The Rock,” Bulger dashed off a letter to the Rev. John O’Shea, a prison chaplain he befriended while in Atlanta, apologizing for leaving without saying goodbye.

“You were very kind to me and patient, I really appreciate it,” Bulger wrote. “I was always on edge down there and never did thank you. I hope that some day our paths will cross again, not in prison though and we can both have a laugh talking about that shook-up Bostonian.”

In closing, Bulger wrote, “No white Christmas this year but I did receive cards from all of my friends.”

O’Shea followed up with a letter to the Alcatraz warden, assuring him that Bulger “does have some good points and I feel confident that with God’s help he can straighten up and get away from his former activities.”

However, he added, “I am not laboring under any false impression that he was St. Aloysius or an altar boy type on the outside because I know he was a tough little nut in the free world but I feel quite confident that he never at any time told me a lie, either about his activities in here or on the outside.”

Alcatraz officials were forming their own opinions about Bulger, and noted he was a dependable worker in the laundry room, but had trouble controlling his temper and “resents bitterly any disparaging remarks made by others about religion, Country and womanhood.”

Bulger told authorities he did not attend prison church services because other inmates sneered at the clergy and criticized them.

It’s unclear whether Bulger’s vow to rehabilitate himself was genuine or part of a self-serving effort to win parole, but either way, he quickly reverted to his life of crime after his release from prison.

“There’s a couple of commandments he overlooked, like ‘Thou Shalt Not Kill,’” said Kelly, the former prosecutor.

While Bulger was awaiting trial, he complained in a letter to a friend, “This cell is freezing right now …. I’ll welcome the warmth of Hell if there is a Hell – can then Thaw Out.”

Shelley Murphy is a reporter for The Boston Globe and co-author with Kevin Cullen of “Whitey Bulger: America’s Most Wanted Gangster and the Manhunt that Brought Him to Justice.”