Donald Trump called for outlawing immigrants from areas of the world with a history of terrorism as part of his proposed temporary ban on all Muslims entering the United States.
The move would be a radical rewriting of US counter-terrorism policy that he argued was essential to protect the peace and security of women and gays in particular.
The Republican Party's presumptive presidential nominee escalated his already controversial rhetoric about immigrants in the wake of the massacre at a gay nightclub, even though the shooter was born in New York.
Trump accused American Muslims of harbouring terrorists and blamed them for the Orlando attack as well as for last December's shooting in San Bernardino, California.
"The Muslims have to work with us," Trump said in a speech in New Hampshire. "They know what's going on. They know that [Orlando gunman Omar Mateen] was bad. They knew the people in San Bernardino were bad. But you know what? They didn't turn them in. And you know what? We had death and destruction."
In a speech laden with falsehoods and exaggeration, Trump was antagonistic and pugnacious, in stark contrast to his Democratic opponent, Hillary Clinton, who also spoke about combatting terrorism. Trump denounced President Barack Obama and Clinton for "deadly ignorance" and warned that they were endangering lives with weakness and indecision.
"We need to tell the truth also about how radical Islam is coming to our shores," Trump said. He added, "We need a new leader. We need a new leader fast. . . . They have put political correctness above common sense, above your safety and above all else. I refuse to be politically correct."
While Trump was fiery and combative, Clinton was cool and collected.
Trump outlined a racially charged overhaul of the nation's immigration laws and a nationalistic, defensive posture in fighting terrorism, while Clinton advocated continuing and in some cases enhancing existing policies from the Obama Administration in which she served.
The former Secretary of State said that the terrorist threat is "metastasising" and vowed to root out so-called lone wolves who might carry out attacks and to ramp up the air campaign targeting Isis (Islamic State) forces in Iraq and Syria. She declared that "inflammatory anti-Muslim rhetoric" alienates peace-loving Muslims and inhibits US efforts to combat terrorism.
Clinton stressed the importance of alliances in the Middle East while also calling out some regional partners by name - Kuwait, Qatar and Saudi Arabia - for supporting radical schools and mosques that have given birth to extremism and for allowing their citizens to fund extremist organisations.
Trump mentioned Clinton 19 times in his speech, tearing into her with so much gusto that one Clinton ally, Representative John Lewis tweeted, "Donald, you need to shut up. Give the American people time to grieve".
Clinton deliberately refrained from mentioning Trump by name - although her entire speech served as a rebuttal to his candidacy. In lieu of the sharp personal attacks she levelled at Trump this month in San Diego, Clinton argued forcefully for national unity.
"This has always been a country of 'we,' not me,'" Clinton said in a speech in Cleveland. "We stand together because we are stronger together. E pluribus unum - out of many, one - has seen us through the darkest chapters of our history."
Trump, however, argued that this is exactly the kind of "politically correct" leadership style that has made the United States susceptible to attacks from radical jihadists.
"The current politically correct response cripples our ability to talk and to think and act clearly," he said. "We're not acting clearly, we're not talking clearly, we've got problems. If we don't get tough, and if we don't get smart, and fast, we're not going to have our country anymore. There will be nothing - absolutely nothing - left."
Trump's accusations about Muslims and call to ban followers of the world's fastest-growing religion from entering the country - first outlined in December in the wake of the San Bernardino shooting - galvanised Republican primary voters, who saw in him a strong and decisive leader who would protect the country and take the fight to the enemy.
Peter Wehner, a former adviser to President George W. Bush, said Trump relies on appeals to ethnic nationalism because he is ignorant about the nuances of counter-terrorism policy. He said "racial resentment" is the basis of Trump's appeal to voters.
"He relishes this kind of stuff," Wehner said. "He takes a horrific incident like what happened in Orlando, and he attempts to inflame the situation. Unfortunately, this tragedy is going to help him rather than hurt him."
Just as they did in December, Trump's ideas and rhetoric drew swift and stern condemnations.
Ibrahim Hooper, a spokesman for the Council on American-Islamic relations, called Trump's comments "truly disturbing".
"It's designed to demonise and stigmatise a religious minority," Hooper said. "And why he thinks this is the way to go is really beyond belief. Obviously, he thinks he's going to get some cheap political advantage out of this kind of bigoted rhetoric."
Farhana Khera, executive director of Muslim Advocates, a national legal advocacy and educational organisation, said Trump's comments could spur an increase in hate crimes targeting American Muslims.
"These kinds of comments give a green light to the American people, and unfortunately some people who might be feeling particularly emotional or other unstable people, to engage in acts of hate," Khera said. In the midst of the Ramadan holiday, she added, the Muslim community is feeling especially vulnerable.
Representative Adam Kinzinger, an Air Force veteran who flew missions in Iraq and Afghanistan, said it would be detrimental to demonise an entire religion as Trump is doing.
"To just simply say ban them all - I think frankly does more harm," Kinzinger said. "It may work for political season and it does, maybe it's a popular sound bite, but it is very detrimental to our long-term ability to actually win this war."
In his speech, delivered with the aid of teleprompters at St Anselm College's New Hampshire Institute of Politics, Trump appeared to expand his policy. If elected, he said, he would "suspend immigration from areas of the world where there's a proven history of terrorism against the United States, Europe or our allies until we fully understand how to end these threats".
Katrina Pierson, a national spokesperson for the Trump campaign, said this is an evolution of his previous Muslim prohibition and not a ban on a new class of people.
"What he was doing was reiterating that the terrorists we're dealing with are Muslim and mostly come from Muslim nations," Pierson said. "The language may have been a little different, but it was a reiteration of what he's been saying for months."
Trump described his proposal as "a responsible immigration policy".
"We cannot continue to allow thousands upon thousands of people to pour into our country, many of whom have the same thought process as this savage killer," Trump said, a reference to the Orlando shooter. "Many of the principles of radical Islam are incompatible with Western values and institutions."
Trump also faulted Clinton and Obama on the issue of guns, a subject that already has become an emotional fault line in the campaign. The Democrats want to restrict access to semi-automatic weapons, such as the AR-15, used in both the Orlando and San Bernardino shootings, but Trump said this amounts to letting terrorists "have all the fun they want."
Trump - who previously had supported gun restrictions and spoke favourably last year of banning gun sales to those on terror watch lists - advocated expanding access to firearms. He said he would be meeting with officials of the National Rifle Association, which endorsed him last month, "to discuss how to ensure Americans have the means to protect themselves in this age of terror".
Like the President, Clinton has advocated tougher restrictions on gun purchases, including universal background checks.
"Weapons of war have no place on our streets," she said today. "If the FBI is watching you for a suspected terrorist link, you shouldn't be able to just go buy a gun with no questions asked."
Clinton acknowledged that gun control may not stop every shooting or terrorist attack but said that "it will stop some and it will save lives and it will protect our first responders."