Messages of support flooded in for the veteran Republican following news he was suffering from an aggressive form of the disease.
But among the positive messages sent from former presidents Barack Obama, Bill Clinton and George W Bush, was an outpouring of anger and hate.
The far-right message board 4chan was awash with toxic comments, with Newsweek quoting one post saying: “The last president for McCain will be Trump.
“There’s some godly justice right there.”
Another wrote: “I’m pretty sure that God is punishing him. God made it pretty clear that he supports New Right now.”
Others social media sites were also filled with messages for Mr McCain, with one twitter user posting: “Finally cancer has helped our society.”
Another tweeted: “Hey John !! How’s The Headache??”
A third wrote: “An unfortunate tumour found itself inside the skull of a malignant John McCain.”
The senator for Arizona has been vocal of his disdain for Mr Trump, criticising the president’s stance against the media earlier this year.
The former presidential candidate said Mr Trump labelling the media as the enemy was how “dictators get started".
In an interview given in February, The Washington Post quoted Mr McCain as saying: “When you look at history, the first thing that dictators do is shut down the press.
“And I'm not saying that President Trump is trying to be a dictator. I'm just saying we need to learn the lessons of history.”
Mr Trump has also lashed out at the former Navy pilot, saying in 2015: “He’s not a war hero.
“He was a war hero because he was captured. I like people who weren’t captured.”
Just hours after his diagnosis, Mr McCain took another swipe at Mr Trump and the decision to end a CIA backed programme for Syrian rebels fighting Bashar Al-Assad’s regime.
He issued a statement saying: "If these reports are true, the administration is playing right into the hands of Vladimir Putin.
"Making any concession to Russia, absent a broader strategy for Syria, is irresponsible and short-sighted."
After news of Mr McCain’s diagnosis Mr Trump sent a message of support to him and his wife, Cindy.
It said: “Senator John MCain has always been a fighter, Melania and I send our thoughts and prayers to Senator McCain, Cindy, and their entire family.
“Get well soon."
Join our commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies