Arizona Sen. John McCain underwent surgery during the weekend to “treat an intestinal infection related to diverticulitis,” his office said on Monday.

McCain, 81, who is also battling brain cancer, is said to be in “stable condition” after he was admitted to the Mayo Clinic in Phoenix.

“Over the last few months, Senator McCain has been participating in physical therapy at his home in Cornville, Arizona, as he recovers from the side effects of cancer treatment,” McCain’s office said in a statement. “He has remained engaged on his work as Chairman of the Senate Armed Services Committee, and has enjoyed frequent visits from his family, friends, staff and Senate colleagues.

“Senator McCain and his family are grateful to the senator’s excellent care team, and appreciate the support and prayers they continue to receive from people all over the country,” his office said.

Meghan McCain, the senator's daughter and current co-host of "The View," noted her father's "intense grit and determination" in a Monday evening tweet.

"Thank you to the doctors at Mayo Clinic in Phoenix and to everyone who is praying for him," she wrote.

McCain, the long-time Republican Arizona senator and 2008 GOP presidential nominee, was diagnosed in July with brain cancer.

“The prognosis is very, very serious,” McCain said at the time. “Some say three percent, some say 14 percent. It’s a very poor prognosis. So, I just said, ‘I understand, now we’re going to do what we can, get the best doctors we can find, and do the best we can.’ And, at the same time, celebrate with gratitude a life well-lived.”

According to the American Brain Tumor Association, more than 12,000 people a year are diagnosed with glioblastoma, a particularly aggressive type of brain tumor. The American Cancer Society puts the five-year survival rate for patients over 55 at about 4 percent.

Fox News' Chad Pergram contributed to this report.