Sen. John McCain, who has been battling an aggressive form of brain cancer, will no longer receive treatment, his family announced Friday as reports said his death was imminent.

Last summer, the Arizona Republican and war hero, who turns 82 next week, said he had been diagnosed with an aggressive glioblastoma — “and the prognosis was serious,” his family said in a statement.

“In the year since, John has surpassed expectations for his survival. But the progress of disease and the inexorable advance of age render their verdict,” the family said.

“With his usual strength of will, he has now chosen to discontinue medical treatment. Our family is immensely grateful for the support and kindness of all his caregivers over the last year, and for the continuing outpouring of concern and affection from John’s many friends and associates, and the many thousands of people who are keeping him in their prayers. God bless and thank you all.”

McCain’s family has gathered in Arizona, where people close to him say his days are numbered, according to The New York Times.

McCain, who had been undergoing treatment since July 2017, has been absent from Washington since December.

The median survival time for glioblastoma patients who have surgery and standard treatment is 15 to 16 months.

His daughter Meghan McCain, 33, expressed her family’s gratitude on Twitter to “all the love and generosity you have shown us during this past year.”

Earlier this month, the political commentator and co-host of ABC’s “The View” told Glamour magazine that her father “is the sun in my universe.”

McCain’s wife, Cindy, also took to Twitter, saying: “I love my husband with all of my heart. God bless everyone who has cared for my husband along this journey.”

McCain is in his sixth term representing Arizona and has spent more than three decades in the upper chamber of Congress.

The son and grandson of four-star Navy admirals also is a former US Navy pilot who spent more than five years as a prisoner of war in the so-called “Hanoi Hilton” POW prison in Vietnam, where he was routinely beaten and tortured after his jet was shot from the sky.

Nevertheless, President Trump has trashed McCain for years, and continued rebuking the ailing senator even as he fought for his life, in part for voting against Trump’s repeal of ObamaCare.

“He campaigned on repealing and replace, we had all the votes, and perhaps he was grandstanding, who knows what he was doing? But you know what? He said, ‘No, no’” Trump said at a South Carolina rally earlier this summer.

“Everybody said, ‘What the hell happened?’ He’s been campaigning for eight years — repeal and replace. And he didn’t do that.”

In July 2015, then-candidate Trump attacked McCain — the GOP nominee for president in 2008 — for being a former POW.

“He’s not a war hero,” Trump, who received five deferments to avoid serving during the Vietnam War, including one for bone spurs in his heel, said in Iowa.

“I like people that weren’t captured. He’s a war hero because he was captured. I like people that weren’t captured,” Trump said on the campaign trail.

Earlier this month, the president visited Fort Drum in upstate New York to sign a $716 billion defense bill named in McCain’s honor — but never referred to the senator by name.

On Friday, Trump offered his “warmest regards” to murderous North Korean dictator Kim Jong-un in a tweet — but made no public comment on McCain’s deteriorating condition.

In July, McCain, chairman of the Senate Armed Services Committee, slammed Trump for his “disappointing” behavior during a NATO summit and took the president to task for referring to the president of Russia as a “competitor.”

“Putin is not America’s friend, nor merely a competitor. Putin is America’s enemy — not because we wish it so, but because he has chosen to be,” McCain said at the time.