Image copyright Reuters Image caption William Barr, right, has been seen as an ally of Donald Trump

US Attorney General William Barr has said that President Donald Trump "undercuts" him by tweeting, making it "impossible for me to do my job".

His criticism of Mr Trump comes amid intense scrutiny of the Justice Department over the handling of a case involving Roger Stone - a convicted former advisor to the president.

The attorney general had been accused of bowing to presidential pressure.

Mr Barr's comments are a rare sign of annoyance with Mr Trump.

"I think it's time to stop the tweeting about Department of Justice criminal cases," Mr Barr told ABC News.

"I cannot do my job here at the department with a constant background commentary that undercuts me," he added.

Senate Majority Leader Mitch McConnell said that the president should listen to Mr Barr's advice.

"If the attorney general says it's getting in the way of doing his job, the president should listen to the attorney general," the Republican senator told Fox News.

There was widespread anger this week when the Justice Department said it planned to reduce the length of the prison sentence it would seek for Stone, a long-time friend of the president.

Stone was convicted in November of obstructing an investigation by the House Intelligence Committee into Russian interference in the 2016 election.

Federal prosecutors had initially recommended that Stone should face seven to nine years in jail for trying to thwart the investigation.

Image copyright EPA Image caption According to a Netflix documentary about his political career, Roger Stone convinced Donald Trump to run for president

The president swiftly voiced his opposition, tweeting: "This is a horrible and very unfair situation."

The Justice Department then overruled the recommendation by its own prosecution team, prompting questions over whether Mr Barr had intervened on behalf of Mr Trump's ally. The four prosecutors then quit.

President Trump praised Mr Barr for "taking charge" of the case.

Mr Barr insisted the president "has never asked me to do anything in a criminal case", but said his tweets about active cases were making it "impossible for me to do my job".

"Do you go forward with what you think is the right decision or do you pull back because of the tweet? And that just sort of illustrates how disruptive these tweets can be," he said.

Mr Barr added: "I'm not going to be bullied or influenced by anybody ... whether it's Congress, a newspaper editorial board, or the president."

The attorney general said that he hoped Mr Trump would respect his words.

"I hope he will react," he said.

Mr Barr was appointed attorney general in February last year. He has been seen since as a close ally of the president, in contrast to the strained relationship Mr Trump had with Mr Barr's predecessor, Jeff Sessions.