US Republicans lashed out at Secretary of State John Kerry on Wednesday after he suggested that Islamist militants had a "rationale" for the attack on the Charlie Hebdo satirical magazine in Paris in January that killed 12 people.Speaking to US Embassy staff in France after attacks last Friday that killed 129 people, Kerry sought to contrast the two incidents, saying the Charlie Hebdo killings appeared to have a motivation, while those last week were indiscriminate.The magazine had angered some Muslims by publishing cartoons depicting the Prophet Mohammad and Islamic themes. The gunmen who attacked the magazine's offices were shown on video shouting: "We have avenged the Prophet Mohammad."Referring to Friday's attacks, Kerry said: "There's something different about what happened from Charlie Hebdo, and I think everybody would feel that.""There was a sort of particularized focus and perhaps even a legitimacy in terms of - not a legitimacy, but a rationale that you could attach yourself to somehow and say, 'OK, they're really angry because of this and that'," Kerry said."This Friday was absolutely indiscriminate. It wasn't to aggrieve one particular sense of wrong. It was to terrorize people," he added.Republican Senator John McCain, who was defeated by Democrat Barack Obama in the 2008 US presidential election, denounced Kerry, who is a fellow Vietnam War veteran and worked alongside him in the Senate for years."It does reveal an underlying view of these things that is really harmful and ... that is damaging," McCain told Fox News. "John Kerry has probably been the most inept secretary of state, certainly in my lifetime."Republican presidential candidate George Pataki, a former New York governor, called on Twitter for Kerry to resign. Several other Republican presidential contenders, including former Florida Governor Jeb Bush, also criticized Kerry for the remarks.State Department spokesman John Kirby, asked at a briefing about Kerry's comment, told reporters the secretary was simply citing the militants' own rationale for the attack on Charlie Hebdo, not trying to say it was justified.He added that Kerry had said in Paris after both attacks that "no act of terrorism is justified, and there can be no rationale for the senseless, indiscriminate killing of innocent people."