Kelly is suffering from squamous cell carcinoma, but he has recently undergone tests to show that the cancer is isolated in his jaw and has not spread to other parts of his body.
"The past couple of weeks have been difficult for me," Kelly said. "Because of the nature of social media, I thought it would be best to share with everyone what has been going on with my health."
The announcement was made Monday morning, just before the start of the quarterback's Kelly For Kids charitable foundation's annual celebrity golf tournament.
"Doctors have told me that my prognosis for recovery is very good," he said.
Kelly spent 11 seasons with the Bills before retiring following the 1996 campaign. He still holds nearly every significant career franchise passing record -- 35,467 yards, 237 touchdowns and 26 300-yard games.
"The first thought is you say a prayer that everything works out OK," said Bill Polian, former general manager of the Bills. "Secondly, he didn't earn a reputation as the toughest guy ever to play quarterback for no reason at all. So if anybody can overcome this, Jim can. He takes challenges head on."
Kelly was inducted into the Pro Football Hall of Fame in 2002.
"I am extremely confident in my road to recovery," Kelly said. "I plan to tackle this challenge head on, as we Kellys always do, with toughness perseverance and faith."
Concerns about the 53-year-old's health were first raised last week when his wife, Jill Kelly, posted a message published on imgur.com. Without going into detail, Jill Kelly noted that the family was going through a "more serious battle under our roof," and asked followers to pray for her husband "for healing."
Later, a youth sports foundation in Sioux Falls, S.D., announced that Kelly would not be able to attend the Hy-Vee/Sanford Legends banquet on June 13 for personal reasons.
Jill Kelly noted the cancellation with a post on her Twitter account on Friday in responding to a person disappointed the quarterback won't be attending the banquet.
"He is disappointed as well," Jill wrote. "But his health must come first! Please pray for him:)"
Jim Kelly has encountered numerous health problems over the past few years, and has had surgery to correct back, neck and hernia problems.
Then, in mid-March, Kelly revealed in an interview with the State Journal-Register of Springfield, Ill., that he recently had surgery to remove a cyst -- which he's described as being "the size of a nickel" -- from his gums and nasal cavity. As part of the operation, doctors had to pull out his front teeth, Kelly said.
Kelly appeared to be having no setbacks in his recovery, after making numerous public appearances over the past month.
Kelly was in good spirits attending rookie quarterback EJ Manuel's first news conference at the Bills' facility on April 26, a day after Buffalo selected the player in the first round of the draft.
Two weeks ago, Kelly watched a Bills' practice session from the sideline, after which he chatted up several players.
On May 26, Kelly joined country music artist Tim McGraw on stage and threw footballs into the crowd during a concert outside Buffalo.
Jill Kelly posted photos of her husband with McGraw, as well as Jim attending The Preakness in Baltimore on May 18.
"Anytime someone close to you is stricken with this disease, it causes you to take a deep breath and step back," Polian said. "Fortunately, however, when you exhale, you realize, in this day and age, it's not the be-all, end-all that it used to be."
Kelly was upbeat in addressing reporters on Sunday, while attending his charity's annual gala and auction, noting that his 84-year-old father Joe was in attendance. He said this year's event was projected to raise close to $5 million. And he noted how this was an opportunity to see many friends and former teammates.
"Jim's a fighter. We think he'll be OK. We're all in his corner," former Bills receiver Andre Reed said. "He's such a resilient guy, and that's been our motto forever, in whatever we did.
"He's got the support, and Jim will be OK."
The Kelly for Kids Foundation was established in 1987, and has since donated tens of millions of dollars to numerous organizations around the region.
Kelly later founded the Hunter's Hope Foundation in honor of his son, Hunter, who was born in 1997 with Krabbe disease. That's an inherited degenerative disorder of the central and peripheral nervous systems. The disease hinders development of the myelin sheath, a fatty covering that protects the brain's nerve fibers.
Given little more than three years to live, Hunter died at the age of 8 in 2005.
Take ABC13 with you!
Download our free apps for iPhone, iPad and Android devices