The inquiry carried explosive implications. Counterintelligence investigators had to consider whether the president's own actions constituted a possible threat to national security. Agents also sought to determine whether Mr. Trump was knowingly working for Russia or had unwittingly fallen under Moscow's influence.
The investigation the F.B.I. opened into Mr. Trump also had a criminal aspect, which has long been publicly known: whether his firing of Mr. Comey constituted obstruction of justice.
Agents and senior F.B.I. officials had grown suspicious of Mr. Trump's ties to Russia during the 2016 campaign but held off on opening an investigation into him, the people said, in part because they were uncertain how to proceed with an inquiry of such sensitivity and magnitude. But the president's activities before and after Mr. Comey's firing in May 2017, particularly two instances in which Mr. Trump tied the Comey dismissal to the Russia investigation, helped prompt the counterintelligence aspect of the inquiry, the people said.