Republican Sen John McCain said on Thursday that President Barack Obama is "directly responsible" for the mass shooting in Orlando, Florida, because of the rise of the Islamic State group on the president's watch.
McCain, who lost to Obama in the 2008 presidential election, made the comment on Thursday while Obama was in Orlando visiting with the families of those killed in Sunday's attack and some of the survivors.
"Barack Obama is directly responsible for it, because when he pulled everybody out of Iraq, al-Qaida went to Syria, became ISIS, and ISIS is what it is today thanks to Barack Obama's failures, utter failures, by pulling everybody out of Iraq," a visibly angry McCain told reporters in the Capitol as the Senate debated a spending bill.
"So the responsibility for it lies with President Barack Obama and his failed policies," McCain said.
The gunman, Omar Mateen, killed 49 people and injured more than 50 in the attack at a gay nightclub. The 29-year-old Muslim born in New York made calls during the attack saying he was a supporter of the Islamic State. But he also spoke about an affiliate of al-Qaida and Hezbollah, both of which are IS enemies.
In the aftermath of the shooting, presumptive Republican presidential nominee Donald Trump has accused Obama of putting US enemies ahead of Americans.
Trump also has suggested that Obama himself might sympathize with radical elements.
Democrats criticised Trump and some Republicans tried to distance themselves from his remarks.
McCain is seeking a sixth Senate term from Arizona and is locked in a tight race.
Questioned on his startling assertion, McCain repeated it: "Directly responsible. Because he pulled everybody out of Iraq, and I predicted at the time that ISIS would go unchecked and there would be attacks on the United States of America. It's a matter of record, so he is directly responsible."
However, McCain later sought to clarify his comments, saying over Twitter: "To clarify, I was referring to Pres Obama's national security decisions that have led to rise of #ISIL, not to the President himself."
Democrats quickly pounced on McCain's criticism. Adam Jentleson, a spokesman for Senate Minority Leader Harry Reid, D-Nev, said McCain's "unhinged comments are just the latest proof that Senate Republicans are puppets of Donald Trump."