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.
The six-term senator and 2008 Republican presidential nominee was diagnosed after doctors discovered his tumour during surgery to remove a blood clot from above his left eye last July.
The son and grandson of Navy admirals, Mr McCain was a fighter pilot during the Vietnam War. When his plane was shot down, he spent more than five years as a prisoner of war.
While in the custody of his captors, he suffered torture that left him with lasting disabilities.
Tributes began to pour in for Mr McCain as soon as the news of his death was announced.
Donald Trump, whom Mr McCain has strongly criticised, tweeted: “My deepest sympathies and respect go out to the family of Senator John McCain. Our hearts and prayers are with you!”
Sarah Palin, who was Mr McCain’s running mate during his 2008 bid for president, said the world had lost “an American original”, sharing a picture of herself with the man she called her friend.
Barack Obama, the Democrat who beat Mr McCain to the presidency, said despite their differences, they shared “a fidelity to something higher – the ideals for which generations of Americans and immigrants alike have fought, marched and sacrificed.
“Few of us have been tested the way John once was, or required to show the kind of courage that he did,” Mr Obama said. “But all of us can aspire to put the courage to put the greater good above our own.
Former vice-president, long-time friend and political opponent Joe Biden said Mr McCain’s “impact on America hasn’t ended”.
“John McCain’s life is proof that some truths are timeless,” he said in a statement. “Character. Courage. Integrity.
“A life lived embodying those truths casts a long, long shadow. John McCain will cast a long shadow.”