Prison guards almost certainly allowed inmates to fatally assault James “Whitey” Bulger following his arrival at a West Virginia lockup — and high-ranking federal officials probably transferred the notorious Boston gangster there to “get rid of him,” an ex-con-turned-journalist told The Post on Wednesday.

“It just seems impossible to me that this could have happened without awareness, not only at the level of the guards on the tier,” writer and producer Richard Stratton said.

Stratton said it was inconceivable that Bulger, an infamous FBI informant who helped the feds decimate his Mafia rivals, wouldn’t be placed in protective custody at the Hazelton penitentiary, where two inmates were killed in separate incidents earlier this year.

“He’s going to be exposed in a way where he can easily be killed, and then one day later he’s murdered,” Stratton said.

Stratton, who co-produced the 2002 HBO documentary “Gladiator Days: Anatomy of a Prison Murder,” also noted that the federal Bureau of Prisons reportedly transferred Bulger out of an Arizona prison in 2014 over allegations of an improper relationship with a female psychologist there.

“It’s not like Whitey’s going to stop f–king scamming because he’s in prison,” Stratton said.

“It’s so obvious that they wanted to get rid of him, that he was a pain in the ass to them.”

Stratton, a former drug smuggler who served eight years in federal prison, said he once sought help from Bulger when the Mafia tried to muscle in on a scam in which he was sneaking hashish from Lebanon through Boston’s Logan Airport.

After refusing to cough up $1 million and half of whatever drugs he brought into the US, “I heard they put out a contract on me,” said Stratton, who also recounted the episode in his 2016 memoir, “Smuggler’s Blues: A True Story of the Hippie Mafia.”

“I went to Whitey and Whitey squashed the whole thing,” he said.

“Then I had to move a load of pot for him.”

Stratton, a Massachusetts native, wrote two articles about Bulger for Playboy magazine and most recently directed the A&E network’s documentary miniseries “Gotti: Godfather & Son.”

A spokesman for the Hazelton penitentiary referred questions to BOP headquarters in Washington, DC, which didn’t respond to an email seeking comment.