WASHINGTON—Former FBI director James Comey told members of Congress this week that he was concerned officials in the bureau’s New York field office had leaked sensitive information to prominent Trump supporter Rudy Giuliani in the closing days of the 2016 presidential campaign.

Speaking on Capitol Hill at a closed-door deposition, Mr. Comey said that he ordered a leak probe after Mr. Giuliani made public statements that indicated he had inside knowledge of the FBI investigation into whether Hillary Clinton mishandled classified information.

“I was concerned that there appeared to be in the media a number of stories that might have been based on communications reporters or non-reporters like Rudy Giuliani were having with people in the New York field office,” Mr. Comey said in a transcript of his Friday appearance before the House Judiciary and Oversight committees that was released Saturday.

Mr. Giuliani didn’t immediately respond to a request for comment, but has previously denied getting information from anyone in the New York field office. He said he heard rumors about the Clinton investigation from retired FBI agents as well as from media reports.

“Mr. Giuliani was making statements that appeared to be based on his knowledge of workings inside the FBI New York,” Mr. Comey said. “And then my recollection is there were other stories that were in the same ballpark that gave me a general concern that we may have a leak problem—unauthorized disclosure problem out of New York, and so I asked that it be investigated.”

Mr. Comey said he was fired from the Federal Bureau of Investigation before the outcome of the probe was complete, and the status of the investigation is unknown.

The former FBI director has previously expressed concerns about possible leaks out of the bureau’s New York office, but his comments to Congress were his strongest statement to date about his suspicions that Mr. Giuliani, a top surrogate to then-candidate Donald Trump, had received inside information from the FBI.

Mr. Giuliani, the former mayor of New York, previously served as the top federal prosecutor in New York, where he worked closely with the FBI’s operations in the city. That background afforded him extensive contacts in the city’s law-enforcement community.

The FBI launched an investigation into Mrs. Clinton’s handling of classified information, related to her use of a private email server during her tenure as secretary of state. It closed the investigation in July 2016 without recommending charges, only to reopen it just days before the election after new evidence was uncovered by agents in New York.

In the days before the FBI announced it was reopening the investigation, Mr. Giuliani appeared on television several times hinting big developments in the case were on their way.

On Friday, Mr. Comey was also asked about his relationship with Special Counsel Robert Mueller, who is investigating the Trump campaign’s ties to Russia. In a September interview with The Daily Caller, Mr. Trump said that Mr. Mueller was “Comey’s best friend” and said he could give the publication “100 pictures of him and Comey hugging and kissing each other.”

The former FBI director characterized his relationship with the special counsel as one of an associate.

“I admire the heck out of the man, but I don’t know his phone number, I’ve never been to his house, I don’t know his children’s names,” Mr. Comey said. “I think I had a meal once alone with him in a restaurant... We’re not friends in any social sense.”

The special counsel was appointed seven days after Mr. Comey was fired, and Mr. Comey testified that he had no interaction with Mr. Mueller during that week.

In October, the FBI responded to a records request for “photographs of former FBI Director James Comey and Robert Mueller hugging and kissing each other,” by saying “no responsive records were located.”

Mr. Comey said there were no such photographs because, while he admires Mr. Mueller’s work, he’s “not that kind of admirer.”

Write to Byron Tau at byron.tau@wsj.com and Natalie Andrews at Natalie.Andrews@wsj.com