I have been very critical of John McCain, but I would wish this on no one.

Senator McCain has been diagnosed with an especially aggressive form of brain cancer, the same that took the life of fellow Senator Ted Kennedy.

WASHINGTON — Senator John McCain, the 2008 Republican presidential nominee known for his independent streak over more than three decades representing Arizona in the Senate, has brain cancer, his office disclosed Wednesday night in a statement from the Mayo Clinic, according to The New York Times.

The statement said the medical condition was discovered after Mr. McCain, 80, who was re-elected to a sixth term in November, underwent surgery to remove a blood clot above his left eye at the Mayo Clinic Hospital in Phoenix.

“Subsequent tissue pathology revealed that a primary brain tumor known as a glioblastoma was associated with the blood clot,” the statement said. “Treatment options may include a combination of chemotherapy and radiation.”

Medical experts said his condition was extremely serious. Eugene S. Flamm, chairman of neurosurgery at Montefiore Hospital in the Bronx, said that “a glioblastoma is the most common and most malignant of brain tumors.”

The median survival is about 16 months, he said. Senator Edward M. Kennedy, Democrat of Massachusetts, died in 2009 from this kind of aggressive brain tumor, which almost always grows back even after chemotherapy and radiation.

The illness of Mr. McCain, a former Navy pilot who was captured and held as a prisoner during the Vietnam War, had implications this week for the health care debate. His absence caused Senator Mitch McConnell, Republican of Kentucky and the majority leader, to postpone a floor fight until Mr. McCain returned to Washington.

The diagnosis shook the Senate, where Mr. McCain is a popular figure despite his occasionally heated disputes with colleagues in both parties. About a dozen lawmakers who on Wednesday night were gathered in the Dirksen Senate Office Building to explore a health care compromise asked Senator James Lankford, an Oklahoma Republican who is a Baptist minister, to lead them in prayer for their colleague.

“It was very emotional,” said Senator John Hoeven, Republican of North Dakota, who was present. He said finding a solution to the health care impasse was “more challenging without him.”

Mr. McConnell called Mr. McCain a hero to both Senate Republicans and the nation at large.

“He has never shied from a fight, and I know that he will face this challenge with the same extraordinary courage that has characterized his life,” Mr. McConnell said Wednesday night. “We all look forward to seeing this American hero again soon.”

The disclosure on Wednesday suggested that Mr. McCain’s condition was more serious than initially believed, although the statement said that “he is recovering from his surgery ‘amazingly well,’” according to his doctors, “and his underlying health is excellent.”

President Trump on Wednesday night issued a statement urging Mr. McCain to quickly recover.

“Senator John McCain has always been a fighter,” Mr. Trump said.