U.S. Attorney General Jeff Sessions on July 27 told news media that he won't quit his post despite President Donald Trump's sharp criticism of his handling of the investigation into Russia's alleged election meddling.

Trump has repeatedly complained recently about Sessions' decision shortly after he took office to recuse himself from the Justice Department's Russia investigation and his failure so far to prosecute people in the government who leaked details of the investigation to the news media.

Despite these criticisms, which prompted speculation that Sessions might soon be fired or resign, Sessions said in an interview with AP that he has no intention of quitting and will stay "as long as [Trump] sees that as appropriate."

"If he wants to make a change, he has every right," Sessions told AP as he visited El Salvador. "I serve at the pleasure of the president. I've understood that from the day I took the job."

"I believe we are running a great Department of Justice," he said. "I believe with great confidence that I understand what is needed in the Department of Justice and what President Trump wants. I share his agenda."

Sessions told Fox News on July 27 that the barrage of criticism from Trump was "hurtful" but would not prompt him to resign.

"It is kind of hurtful, but the president of the United States is a strong leader," said Sessions, adding that Trump's overwhelming desire was for "all of us to do our jobs. That's what I intend to do."

Trump's attacks on Sessions have galvanized support for the former Alabama senator in Congress, where many legislators this week spoke out in his defense.

On July 27, one of Trump's rivals in last year's presidential campaign, Senator Lindsey Graham, warned of "holy hell" if Trumps sacks Sessions.

"This effort to basically marginalize and humiliate the attorney general is not going over well in the Senate," Graham said in remarks broadcast on CNN. "If Jeff Sessions is fired, there will be holy hell to pay."

Graham added that it would be "the beginning of the end" of Trump's presidency if he tries to fire the special prosecutor, Robert Mueller, who was appointed by the Justice Department to carry out the Russian investigation.

Trump would cross a "red line" with members of Congress if he tries to fire Mueller, Graham said. Trump frequently rails against Mueller and has openly ruminated on whether he should dismiss him.

"Any effort to go after Mueller could be the beginning of the end of the Trump presidency, unless Mueller did something wrong," Graham said.