WASHINGTON (Reuters) - The U.S. Justice Department on Friday dropped its criminal investigation of a top target of President Donald Trump, former No. 2 FBI official Andrew McCabe, at the tail end of a week in which the U.S. law-enforcement agency has come under extraordinary pressure from the president.

Since he was fired by former Attorney General Jeff Sessions in March 2018, McCabe has often been a punching bag for Trump, and the department’s decision not to charge him could further stoke Trump’s ire.

Trump has spent the week criticizing prosecutors, jurors and the judge in a separate case involving his longtime political adviser, Roger Stone, raising questions about whether Trump is eroding the independence of the U.S. legal system.

Trump was irked by the decision, said a source close to the White House. He did not comment as he left Washington for his Mar-a-Lago resort in Florida.

McCabe criticized the Justice Department for taking two years on the case, which examined whether he misled investigators about his decision to share internal communications with a reporter during the 2016 presidential election. Prosecutors had been indicating since July that the investigation was largely complete.

“It is an absolute disgrace that they took two years and put my family through this experience for two years before they finally drew the obvious conclusion and one they could have drawn a long time ago,” he said on CNN.

U.S. Judge Reggie Walton said at a hearing in September that the delays made it seem like the department was facing political pressure.

A lifelong Republican who worked at the FBI for 20 years, McCabe played a crucial role in the bureau’s investigations of Democratic presidential candidate Hillary Clinton and Russian interference in the 2016 U.S. election.

In campaign speeches, interviews and tweets, Trump accused McCabe of conflicts of interest because his wife Jill McCabe, a Democrat, received donations for an unsuccessful 2015 Virginia state senate campaign from a Clinton ally.

FILE PHOTO: Former acting FBI director Andrew McCabe speaks during a forum on election security titled, “2020 Vision: Intelligence and the U.S. Presidential Election” at the National Press Club in Washington, U.S., October 30, 2019. REUTERS/Joshua Roberts

McCabe questioned whether the decision to drop the investigation had anything to do with the ongoing fracas over Stone, a veteran Republican operative who was found guilty in November of lying to Congress, obstruction and witness intimidation.

The Justice Department’s decision to seek a lighter sentence for Stone earlier this week prompted all four prosecutors on that case to resign in apparent protest.

“Like all Americans I’ve been greatly concerned by what I’ve seen take place in the White House and in the Justice Department, quite frankly, in just the last week,” McCabe said.

A Justice Department spokeswoman declined to comment.

McCabe was fired just hours before he was due to retire, after the department’s internal watchdog issued a report saying he misled investigators from the Inspector General’s office who were trying to determine whether he had improperly shared information with a reporter.

The Justice Department under Trump has also dropped its investigations of Clinton and declined to prosecute former FBI Director James Comey.

Trump has taken a string of aggressive actions since the Republican-controlled Senate acquitted him of impeachment charges last week.

Earlier this week, he abruptly yanked the nomination of Jessie Liu, the senior prosecutor who oversaw the Stone case and the McCabe investigation, for a new top job overseeing sanctions at the Treasury Department.

Trump said on Friday he had “the legal right” to interfere in criminal cases, despite an unusual rebuke from Attorney General William Barr, his top law enforcement official.

Barr told ABC News that Trump’s attacks made it “impossible” for him to do his job leading the Justice Department, telling ABC News in an interview: “It’s time to stop the tweeting.”

Barr said Trump had never asked him to interfere in a criminal case.

The president responded on Friday morning: “This doesn’t mean that I do not have, as President, the legal right to do so, I do, but I have so far chosen not to!” he wrote on Twitter.