Preet Bharara, the former United States attorney in Manhattan, said on Sunday that President Trump tried to cultivate a relationship with him in the months before he was abruptly fired in March.

Mr. Bharara said the contacts with Mr. Trump made him increasingly uncomfortable because they broke with longstanding Justice Department rules on communicating with the White House. Mr. Bharara, who first publicly disclosed the contacts and his concerns about them after he was fired, said Mr. Trump’s communications were strikingly similar to those between the president and those described by the former F.B.I. director, James B. Comey, who was fired last month.

“When I’ve been reading the stories of how the president has been contacting Jim Comey over time, felt a little bit like déjà vu,” Mr. Bharara said Sunday on “This Week” on ABC.

In his Senate Intelligence Committee hearing on Thursday, Mr. Comey said he became uneasy with the president’s repeated conversations with him, including a private White House dinner in February. Mr. Comey said he believed that Mr. Trump, who requested his loyalty during the meal, was trying to “create some sort of patronage relationship.”