Being a bodyguard to rock ’n’ roll icons usually means keeping them safe from crazed fans. But as David E. Stanley details in his upcoming memoir, “My Brother Elvis,” it also meant saving the drug-addled King from his own dinner.

Stanley’s account of life with Elvis throws a harsh light on the dark time leading up to the singer’s death in August 1977. The two stepbrothers — Elvis’ widowed father, Vernon, married Stanley’s mom, Dee, in 1960 — were quite close. In the book, out Aug. 16, Stanley reveals how a cocktail of drugs prescribed by quack caretaker Dr. George Nichopoulos would render Elvis so incapacitated that he would nod off while eating, and risk choking on his food.

David E. Stanley holds a photo of Elvis.Frank Rogozienski

“During the last two years of his life, there were more than a dozen times when I had to put my finger down his throat and remove food,” Stanley tells The Post. “He would take three ‘attack-packs’ of medication [at night]. Each one had 11 sleeping pills and three shots of Demerol. During the day, he would counteract [the downers] with amphetamines.”

Elvis suffered from severe constipation that was brought about by his drug use. He took laxatives, but sometimes he couldn’t get to the toilet fast enough because of the attack-packs, and would soil himself. It was Stanley who often cleaned up his brother. “It was the tragedy of tragedies,” he says.

The Elvis that Stanley cared for in his last days was a far cry from the one he grew up idolizing. Stanley, along with his mother, stepfather and two brothers, all lived with Elvis at Graceland, and he viewed the singer as a father figure.

But he began to see another side of Elvis in 1972, when Stanley was 16 and he joined the King’s entourage as a bodyguard. Parts of it were clearly enjoyable; Stanley recalls being deflowered by a gaggle of call girls on Elvis’ orders: “Ladies, I give you the boy,” he said. “Now, give me the man.”

He also recalls watching Robert Plant and Elvis duet on “Love Me Tender” backstage at a show in Los Angeles.

Elvis Presley with his girlfriend Linda Thompson in 1976.WireImage

Stanley knew that Elvis was bored, isolated and heavily reliant on prescription drugs. He recalls his stepbrother asking a doctor for Dilaudid — a painkiller usually administered for cancer patients, but one the singer insisted he needed for an ingrown toenail.

Bizarrely, Elvis had a zero-tolerance policy on illegal drugs within his circle.

“If he caught me smoking weed, he’d wanna fire me,” says Stanley, now 60 and living in San Diego. “He justified his [own drug] use because it was prescribed medication — he wasn’t doing anything illegal.”

When Elvis died at home in 1977, Stanley was one of the first on the scene. The official cause of death was a heart attack, but Stanley feels that may not be the whole story. Three fired bodyguards were about to publish a tell-all exposing Elvis’ drug problem, and Stanley feels that may have pushed him over the edge.

“To me, it was a self-induced drug overdose,” Stanley says. “I lived with a tormented man — the man that said he’d rather be ‘unconscious than unhappy.’ Part of me was relieved when I saw his lifeless body.”

David Stanley is a best-selling author and filmmaker, and has been a motivational speaker against drug abuse for three decades – for more information visit www.davidestanley.com.