The 80-year-old Republican has glioblastoma, an aggressive cancer, according to doctors at the Mayo Clinic in Phoenix.
The Arizona senator and his family are reviewing further treatment, including a combination of chemotherapy and radiation.
The five-year survival rate for glioblastoma patients over 55 is about four per cent.
Patients fare best when surgeons can cut out all the visible tumour, which happened with McCain, according to his office.
However, cancerous cells that are not visible still tend to lurk, which is why McCain’s doctors are considering treatment including chemotherapy and radiation.
Terrible news about our great friend @SenJohnMcCain.
Australia’s thoughts and prayers are with him for a speedy recovery.
— Joe Hockey (@JoeHockey) July 20, 2017
John McCain is an American hero & one of the bravest fighters I’ve ever known. Cancer doesn’t know what it’s up against. Give it hell, John.
— Barack Obama (@BarackObama) July 20, 2017
The chairman of the Senate armed services committee had been recovering at home and his absence forced Republican Majority Leader Mitch McConnell to delay action on healthcare legislation.
In a statement, McConnell said: “John McCain is a hero to our conference and a hero to our country. He has never shied from a fight and I know that he will face this challenge with the same extraordinary courage that has characterised his life.”
McCain was the Republican presidential nominee in 2008, when he and running mate Sarah Palin lost to Barack Obama.
He lost the Republican nomination to George W Bush in 2000.
A navy pilot, he was shot down over Vietnam and held as a prisoner for five years.
Doctors say McCain is recovering from his surgery very well and his underlying health is excellent.
In a statement on Twitter, his daughter, Meghan McCain, said: “My love for my father is boundless and like any daughter I cannot and do not wish to be in a world without him. I have faith that those days remain far away.”
We value local independent journalism. We hope you do too.
InDaily provides valuable, local independent journalism in South Australia. As a news organisation it offers an alternative to The Advertiser, a different voice and a closer look at what is happening in our city and state for free. Any contribution to help fund our work is appreciated. Please click below to become an InDaily supporter.