WASHINGTON (Reuters) - U.S. Senator John McCain said on Thursday that President Barack Obama was “directly responsible” for attacks on Americans like the one in Florida because of policies that contributed to the rise of the Islamic State. But the Arizona Republican later said he misspoke.

U.S. Senator John McCain speaks at the Munich Security Conference in Munich, Germany, February 14, 2016. REUTERS/Michael Dalder

McCain, who is in a tough re-election race, made the comments after reporters chased him down a marble stairway and into a hallway of the U.S. Capitol. They asked what he was hearing from constituents about gun control issues being debated in the Senate after Sunday’s shooting rampage by a gunman who claimed allegiance to Islamic State militants.

“I’m hearing a lot from my constituents about what happened and of course I am making them realize that Barack Obama is directly responsible for it,” McCain said.

“Because when he pulled everybody out of Iraq, al Qaeda went to Syria, became ISIS, and ISIS is what it is today thanks to Barack Obama’s failures, utter failures,” McCain said. “So the responsibility for it lies with President Barack Obama and his failed policies.”

After media reports began to appear about his comments, McCain, who lost the White House to Obama in the 2008 presidential election, posted a clarification on Twitter and then issued a statement that said he meant to blame Obama’s policies, not the president personally.

“I misspoke. I did not mean to imply that the president was personally responsible. I was referring to President Obama’s national security decisions, not the president himself,” McCain said in the statement.

Forty-nine people died in the shooting in Orlando, the worst mass shooting in modern U.S. history. The gunman was U.S.-born Omar Mateen, 29, whose parents immigrated from Afghanistan.

McCain, 79, faces multiple opponents in a Republican primary race in August, and some analysts say he is in danger of losing the Senate seat he has held for three decades.

Earlier this week, presumptive Republican presidential candidate Donald Trump appeared to suggest Obama may have been complicit in the Orlando attacks.

“Look, we’re led by a man that either is not tough, not smart, or he’s got something else in mind,” Trump told Fox News. “And the something else in mind — you know, people can’t believe it ... There’s something going on. It’s inconceivable. There’s something going on.”