“Beleaguered” Attorney General Jeff Sessions is officially out of the Trump doghouse.

Breaking a string of social media rebukes against Sessions, the president issued a tweet Saturday afternoon praising his AG for getting tough on White House leaks.

“After many years of LEAKS going on in Washington, it is great to see the A.G. taking action! For National Security, the tougher the ­better!’’

In a Friday press conference, Sessions vowed to chase down government leakers, and to pressure reporters to give up their sources, possibly by issuing subpoenas demanding source names.

In past weeks, Trump has waged a social media campaign against Sessions, an early campaign supporter who was the first sitting senator to extend his endorsement.

Trump said in an interview that had he known Sessions would recuse himself in the Russian collusion investigation, he would never have nominated him. And in tweets, Trump called Sessions his “beleaguered AG.”

Things got so tense, Sessions tendered his resignation — but it was rejected by Trump.