WASHINGTON — The Justice Department will not charge former acting FBI director Andrew McCabe with lying to investigators about a media disclosure, according to people familiar with the matter and McCabe's legal team, ending a long-running inquiry into a top law enforcement official who authorized the bureau to investigate President Donald Trump and soon became the commander in chief's political punching bag.

The department revealed the decision to McCabe's team Friday, Feb. 14; it was unclear whether there were other plans to make it public. The move was said to infuriate Trump, who has raged publicly and privately in recent months that McCabe and others he considers political enemies should be charged with crimes.

The decision could amplify the tension between Trump and his Justice Department, especially Attorney General William Barr, who on Thursday publicly rebuked the president for tweeting about Justice Department criminal cases.

A White House official said Trump was not given a head's up and was upset, and that White House lawyers moved to calm the president. The official said Trump "believes very strongly that action should be taken."

Michael R. Bromwich and David Schertler, McCabe's lawyers, said in a statement that the D.C. U.S. attorney's office had called and informed them that the case "has been closed." The call was followed by a letter from J.P. Cooney, chief of that office's fraud section, the lawyers said.

"At long last, justice has been done in this matter," the lawyers said. "We said at the outset of the criminal investigation, almost two years ago, that if the facts and the law determined the result, no charges would be brought. We are pleased that Andrew McCabe and his family can go on with their lives without this cloud hanging over them."

McCabe authorized the FBI to begin investigating Trump personally for possible obstruction of justice in connection with the probe into whether the Trump campaign coordinated with Russia to influence the 2016 election.

But the veteran law enforcement official later became the focus of a grand jury probe over allegations from the Justice Department inspector general that he lied to investigators exploring a media disclosure. The investigation was led by the District of Columbia U.S. Attorney's Office; a spokesman for that office declined to comment Friday.

What exactly happened in the case remains unclear. Justice Department officials authorized prosecutors to seek an indictment of McCabe last year, and in September, a grand jury that had been hearing evidence was summoned back after a months-long hiatus to consider the case. But the day came and went with no public charges being filed. McCabe's legal team sought to press the Justice Department for a status update butwas told nothing.

The case was particularly complicated because of Trump's very public attacks on McCabe, which many viewed as an attempt to politicize the Justice Department and seek the prosecution of someone the president viewed as a political foe.

McCabe took over as chief of the FBI after Trump fired James Comey from the post in May 2017. From the start, there was tension between the two men. McCabe has alleged that Trump in one of their early talks called his wife, Jill McCabe, a "loser" because of her failed run for a state Senate seat in Virginia.

Trump denies that. The president, though, has tweeted relentlessly about the former law enforcement official, calling the day he was ousted from the bureau "A great day for Democracy," alleging he damaged the bureau's investigation and suggesting he should be charged with a crime.

In a lawsuit over his firing from the bureau - which came after the inspector general alleged he had lied - McCabe asserted he had been ousted illegally as part of a plot by Trump to remove those who were not loyal to him politically.

The media disclosure at issue came in the fall of 2016, a particularly fraught period in the bureau when officials were wrapping up an investigation of Hillary Clinton's use of a private email server while she was secretary of state and starting to ramp up the Russia case.

McCabe authorized two FBI officials to speak for a Wall Street Journal report detailing tension inside the FBI and Justice Department over the Clinton email case and a separate investigation of the Clinton family foundation. But he initially denied having done so when FBI officials - and, later, the inspector general's office - tried to determine who might have spoken to the media.

The inspector general accused McCabe of lying at least four times, three of them under oath, and even misleading then-FBI Director Comey, his boss.

This article was written by Matt Zapotosky, Josh Dawsey, Karoun Demirjian and Devlin Barrett, reporters for The Washington Post.