A statement released by his office said McCain died on Saturday in Arizona while being surrounded by his family.
He was diagnosed with an aggressive brain tumour in July 2017 and had been undergoing medical treatment.
His family announced on Friday that Mr McCain, who left Washington in December, had decided to stop treatment.
His widow, Cindy, tweeted, “My heart is broken. I am so lucky to have lived the adventure of loving this incredible man for 38 years. He passed the way he lived, on his own terms, surrounded by the people he loved, in the place he loved best.”
McCain’s daughter Meghan said the task of her lifetime would now be “to live up to his example, his expectations, and his love.
The six-term senator for Arizona 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.
His family said he would lie in state in Phoenix, Arizona, and in Washington DC before a funeral at the Washington National Cathedral and his burial in Annapolis, Maryland.
Former presidents Barack Obama and George W. Bush are expected to give eulogies.
The son and grandson of Navy admirals, McCain was a fighter pilot during the war in Vietnam. 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.