A suspect in a bombing was still at large Monday morning, his motives and intentions unknown — but Hillary Clinton and Donald J. Trump were already racing to seize the political upper hand.

With a manhunt still in progress before an arrest later in the day, Mrs. Clinton sought to shift the terms of the presidential contest back in her direction. She called Mr. Trump a “recruiting sergeant for the terrorists” and, from a rainy airport in White Plains, offered herself as a seasoned warrior against terrorism.

Mr. Trump returned fire hours later, blaming Mrs. Clinton and President Obama’s handling of immigration and the Iraq war for bringing terrorism to American shores. He called for vigorous police profiling of people from the Muslim world and drew a direct equation between immigration controls and national defense.

The attacks could reframe the presidential race around stark questions of national security after weeks of often-bitter sniping between Mr. Trump and Mrs. Clinton over more personal matters of character, transparency and medical records. The violence of the weekend is all but certain to ripple in the first presidential debate, set for next Monday at Hofstra University on Long Island.