WASHINGTON (AP) — Federal prosecutors have declined to charge former FBI Deputy Director Andrew McCabe, closing an investigation into whether he lied to federal officials about his involvement in a news media disclosure, McCabe’s legal team said Friday.

The decision resolves a criminal investigation that spanned more than a year and began with a referral from the Justice Department’s inspector general, which said McCabe repeatedly lied about having authorized a subordinate to share information with a newspaper reporter for a 2016 article about an FBI investigation into the Clinton Foundation.

McCabe’s lawyers said in a statement they were told in a phone call and letter that the case is closed and “no charges will be brought against him based on the facts.”

McCabe, a frequent target of attacks from President Donald Trump, has denied that he intentionally misled anyone. He has said his 2018 firing — for what the Justice Department called “lack of candor” — was politically motivated. He sued the Justice Department in August, saying officials had used the inspector general’s conclusions as a pretext to rid the FBI of leaders Trump perceived as biased against him.

In a letter on Friday, prosecutors told McCabe’s lawyers that they decided “not to pursue criminal charges against your client” after careful consideration.

“Based on the totality of the circumstances and all of the information known to the government at this time, we consider the matter closed,” said the letter, signed by the chief of the U.S. attorney’s office’s public corruption unit.

The decision was revealed at the week of startling tensions between Trump and the Justice Department over the treatment of one of the Republican president’s longtime allies and confidants, Roger Stone. It is likely to further agitate Trump, who has repeatedly and loudly complained that the Justice Department has pursued his former aides and advisers but not prosecuted his perceived political foes. Attorney General William Barr pushed back at Trump in a television interview on Thursday, saying the president’s tweets about ongoing criminal cases are making his job impossible.”

The decision to spare McCabe criminal charges eliminates the prospect of a sensational trial that would have refocused public attention on the chaotic months of 2016, when the FBI was entangled in presidential politics through investigations touching both main contenders — Democrat Hillary Clinton and Trump, her Republican opponent.

The investigation by the U.S. attorney’s office in Washington arose from an October 2016 story in The Wall Street Journal that described internal debates roiling the FBI and the Justice Department weeks before the presidential election about how aggressively the Clinton Foundation should be investigated. The article recounted a particularly tense phone call between McCabe and a senior Justice Department official about the investigation.

The inspector general’s report said McCabe repeatedly told internal investigators that he had not authorized anyone at the FBI to speak with the reporter and that he did not know who he did. The report said McCabe ultimately corrected that account and confirmed that he had encouraged the conversation with the reporter to counter a narrative that he thought was false.

McCabe has denied any wrongdoing and has said he was distracted by the tumult surrounding the FBI and the White House — one of the interviews took place the same day that former FBI Director FBI James Comey — during the times he was questioned.

“During these inquiries, I answered questions truthfully and as accurately as I could amidst the chaos that surrounded me,” McCabe has said in a statement. “And when I thought my answers were misunderstood, I contacted investigators to correct them.”

McCabe has been a target of Trump’s attacks since even before he was elected, after news emerged in the fall of 2016 that McCabe’s wife had accepted campaign contributions from a political action committee associated with former Virginia Gov. Terry McAuliffe during an unsuccessful run for the state Senate there.