Federal prosecutors have decided not to pursue criminal charges against former Brooklyn District Attorney Charles J. Hynes over allegations that he improperly diverted criminal forfeiture funds for use on his campaign, according to Hynes’ attorney and legal sources.

Investigators in the office of Brooklyn U.S. Attorney Robert L. Capers notified attorneys for Hynes earlier this week that they were closing out the case and sent a letter Friday notifying the lawyers.

“Following our Office’s investigation regarding whether Mr. Hynes misappropriated public funds, we have concluded that there is insufficient evidence at this time to support filing federal criminal charges. Accordingly, our investigation is closed,” Assistant U.S. Attorney James D. Gatta wrote in a letter to Brooklyn attorney Sean Haran, who represents Hynes.

In a statement to Newsday, Haran said he was gratified that prosecutors reached “the appropriate conclusion that charges are not warranted.”

“We have always been confident that this would be the end result, as Joe faithfully abided his moral and ethical duties,” Haran said.

A spokesman for Capers didn’t immediately respond to a request for comment.

Allegations that Hynes used the forfeiture funds illegally were first raised about three years ago when Hynes, who served for over two decades as Brooklyn’s chief prosecutor, was in the midst of a nasty campaign against newcomer Kenneth Thompson.

Hynes, now 81, lost the Democratic primary to Thompson, who went on to win the election. After serving less than two years as district attorney, Thompson died of cancer in October.

The Hynes probe was first conducted by the city’s Department of Investigation and the state attorney general. The matter was later taken over by federal authorities.

One of the core allegations was that Hynes used the funds to pay for political work by Mortimer Matz, a well-known media spokesman in the city who was a longtime friend of Hynes. Matz worked for years in Hynes’ press office.

“Morty, however, is not and has never been a ‘political consultant,’ the mistaken basis for the NYC DOI’s mischaracterization of Morty’s consulting work for Joe Hynes and the Kings County District Attorney’s Office,” Matz’s attorney, Richard Greenberg, said in a statement. “It is a great day for Morty and NYC that his impeccable reputation has been restored.”