State and federal probes of New York City Mayor Bill de Blasio's fundraising will not result in criminal charges for the mayor or others acting on his behalf, prosecutors said Thursday.

Manhattan District Attorney Cyrus Vance said the facts were insufficient to successfully argue a provable violation of election laws in part because the parties relied on the advice of attorneys. But he said the actions appear to be "contrary to the intent and spirit of the law."

Acting U.S. Attorney Joon H. Kim announced no charges would be brought against de Blasio or others acting on his behalf after a "thorough investigation" into complaints about circumstances in which de Blasio and others solicited donations from individuals who sought official favors from the city.

Kim said in a statement that his office after "careful deliberation" decided against bringing criminal charges resulting from the probe into allegations of misconduct by and on behalf of the Democratic mayor for his 2013 election campaign and the 2014 state Senate effort.

"In considering whether to charge individuals with serious public corruption crimes, we take into account, among other things, the high burden of proof, the clarity of existing law, any recent changes in the law, and the particular difficulty in proving criminal intent in corruption schemes where there is no evidence of personal profit," he wrote.

Kim said it was rare for his office to issue a public statement about the status of an investigation but believed it appropriate "in order not to unduly influence the upcoming campaign and mayor election."

Vance also said he would not prosecute allegations of election violations in state senate races in 2014 but said it didn't mean he condoned the behavior.

"This conclusion is not an endorsement of the conduct at issue; indeed, the transactions appear contrary to the intent and spirit of the laws that impose candidate contribution limits, laws which are meant to prevent 'corruption and the appearance of corruption' in the campaign financing process," he wrote in a letter to the state board of elections.

De Blasio was recently interviewed by federal prosecutors as part of their probe.

The city law office referred requests for comment to the mayor's office, which did not immediately comment.