Senator John McCain, the Vietnam war hero turned senator and presidential candidate, has died aged 81.

Mr McCain died on Saturday surrounded by his family, according to a short statement released by his office.

He was diagnosed with an aggressive brain tumour in July 2017 and had been undergoing medical treatment.

His family announced Mr McCain, who left Washington in December, had decided to stop treatment on Friday.

In a Washington career that spanned 40 years, first as a Navy Senate liaison, then as a member of the House and finally as the occupant of the Senate seat he took over from Barry Goldwater, McCain was a conservative and a foreign policy hawk. But he was not always a reliable Republican vote, and sometimes in a career that stretched into a sixth Senate term, he confounded party leaders with his maverick stands.

He defied party orthodoxy to embrace campaign finance reform, and excoriated President George W. Bush’s defense secretary, Donald Rumsfeld, for not taking enough troops to Iraq.

By 1967, McCain was in the Pacific and escaped death in a massive fire aboard the USS Forrestal aircraft carrier. Months later, he was shot down in his Skyhawk jet over North Vietnam and parachuted into a lake near Hanoi, breaking both arms and a leg, and was captured by communist soldiers. In captivity, McCain was tortured and beaten, an experience that left him with lifelong injuries, including severely restricted movement of his arms. Later, he refused the offer of a preferential release, made because his father was an admiral, until his comrades could also come home, eventually returning in 1973 to a nation politically torn by the war. For his military service, he was awarded the Silver Star, the Bronze Star, the Legion of Merit, a Purple Heart and the Distinguished Flying Cross.

By 2000, McCain set his sights on the White House and ran as a maverick Republican, holding court for hours in candid back-and-forth sessions with reporters on his campaign bus, dubbed the “Straight Talk Express.”

He ran for president twice, lost in the primaries to bush and in the presidential to obama. He was also the only republican to stand up to Trump and criticize him.