WASHINGTON — Two top F.B.I. aides who worked alongside the former director James B. Comey as he navigated one of the most politically tumultuous periods in the bureau’s history resigned on Friday.

One of them, James A. Baker, was one of Mr. Comey’s closest confidants. He served as the F.B.I.’s top lawyer until December when he was reassigned as the new director, Christopher A. Wray, began installing his own advisers. Mr. Baker had been investigated by the Justice Department on suspicion of sharing classified information with reporters. He has not been charged.

The other aide, Lisa Page, advised Mr. Comey while serving directly under his deputy, Andrew G. McCabe. She was assailed by conservatives after texts that she had exchanged with the agent overseeing the investigation into links between President Trump’s campaign and Russia were made public. In the messages, they expressed anti-Trump views but took aim at Hillary Clinton and other political figures as well.

The decisions by Mr. Baker and Ms. Page to leave the bureau were unrelated. Mr. Baker said in a telephone interview that he would be joining the Brookings Institution to write for Lawfare, its blog focused on national security law.