Sen. John McCain, an admiral’s son whose rebellious streak nearly got him expelled from Annapolis but helped him survive North Vietnamese torture and rise to the top of the Republican Party, has died. He was 81 years old.

Mr. McCain died Saturday at his home in Sedona, Ariz., surrounded by his wife, Cindy, and their family, his office said.

The cause was a brain tumor known as a glioblastoma, which was diagnosed in July 2017. On Friday, his family said Mr. McCain had decided to discontinue medical treatment, which had included chemotherapy and radiation that left him weakened as he battled for his life at home in Arizona. He hadn’t been in the Senate since Dec. 7, when he cast his last vote.

Mr. McCain catapulted to national prominence with his 2000 bid for the GOP presidential nomination, when his willingness to challenge ideas held sacred by his party helped him catch fire among Republicans in a long-shot bid against George W. Bush.

Mr. McCain rode in a bus dubbed “the Straight Talk Express,” taking hours of questions from a rotating group of reporters. He won the New Hampshire primary before a loss in South Carolina from which he never truly recovered. He wrote afterward that despite the disappointment, the campaign was “a hell of a lot of fun.”