WASHINGTON — The presidential campaign was rocked on Friday after federal law enforcement officials said that emails pertinent to the closed investigation into Hillary Clinton’s private email server were discovered on a computer belonging to Anthony D. Weiner, the estranged husband of a top Clinton aide.

In a letter to Congress, the F.B.I. director, James B. Comey, said the emails had surfaced in an unrelated case, which law enforcement officials said was an F.B.I. investigation into illicit text messages from Mr. Weiner to a 15-year-old girl in North Carolina. Mr. Weiner, a former Democratic congressman from New York, is married to Huma Abedin, the top aide.

Mr. Comey's letter said that the F.B.I. would review the emails to determine if they improperly contained classified information, which is tightly controlled by the government. Senior law enforcement officials said that it was unclear if any of the emails were from Mrs. Clinton’s private server. And while Mr. Comey said in his letter that the emails “appear to be pertinent,” the F.B.I. had not yet examined them.