President Trump said Friday it's a “shame” what has happened with the FBI, and called the agency’s handling of its investigation into Hillary Clinton’s private email server “really disgraceful.”

The comments came as he departed the White House for Quantico to give a speech to FBI academy graduates.

“Well, it's a shame what's happened with the FBI,” Trump told reporters — before quickly promising to “rebuild” the agency.

Trump also called the release of text messages between two high-profile FBI agents “sad.”

“But it is very sad when you look at those documents. And how they've done that is really, really disgraceful, and you have a lot of very angry people that are seeing it. It's a very sad thing to watch, I will tell you that,” he said of the texts between Peter Strzok and Lisa Page.

Strzok, a senior FBI agent, helped to lead the Clinton investigation before being assigned to special counsel Robert Mueller’s probe of the 2016 presidential election. He was reportedly having an extramarital affair with Page, who was also part of the probe, before they were both removed for their anti-Trump, pro-Clinton messages.

Trump, who tweeted earlier this month that the FBI’s “reputation is in tatters,” told reporters Friday “we’re going to rebuild the FBI, it’ll be bigger and better than ever.”

Trump’s remarks come hours after White House deputy press secretary Hogan Gidley said the disclosed messages show “extreme bias” against Trump among FBI leadership.

"There is extreme bias against this president with high-up members of the team there at the FBI who were investigating Hillary Clinton at the time," Gidley told Fox News Friday morning.