Eagles rocker Glenn Frey suffered from debilitating rheumatoid arthritis for years — and died partly because of the pills he took for it, his manager said Tuesday.

“He died from complications of ulcer and colitis after being treated with drugs for his rheumatoid arthritis, which he had for over 15 years,’’ the singer’s manager, Irving Azoff, told the website The Wrap.

“The colitis and pneumonia were side effects from all the meds,” Azoff said.

The manager, recalling Frey’s struggle with the crippling joint condition, added, “One day, [Frey’s] knees would hurt, his hands hurt.’’ The illness “moves from joint to joint,’’ he said.

Frey’s final decline began roughly a month after his last performance with the Eagles in Bossier City, La., on July 29, said his brother, Alan Frey, to The Post.

Glenn Frey had vacationed in Hawaii after the tour ended but was forced to check into a hospital in Los Angeles with an intestinal infection in October, he said.

Frey briefly recovered — and even planned to perform again with the band at the Kennedy Center Honors cultural achievement awards in Washington, DC, in December. But he was forced to cancel in early November, saying he needed to undergo surgery.

Later that month, he checked into the Manhattan hospital with a bad case of pneumonia, Seger said.

A team of doctors diligently tried to save him — at one point placing him in a medically induced coma, Seger said.

“They were trying like hell to keep him alive . . . [His manager] pulled every ace out of the hole — he had the eight best specialists working on Glenn,” Seger revealed in a tearful interview. But the pneumonia worsened, weakening his immune system and aggravating the pre-existing conditions, Seger said.

“First, he caught one set of pneumonia, then he caught a very virulent set of pneumonia. He was in a coma, and he’d come out, but then he couldn’t breathe. They’d put him back in a coma,” Seger said. “About a month ago, they had to throw up their hands.”

Frey fought to keep his final hospital battle a secret from the world. Frey hated talking about his worsening condition, and no one imagined how bad it really was until the very end, said Alan Frey, 60, a mechanic from Phoenix.