President Donald Trump has criticised FBI leaders while claiming to be "more loyal than anyone could be" to law enforcement.
The US leader was referring to leaked documents which suggest a bias against him among some in the top ranks of the FBI.
He said it was "a shame what happened" with the FBI as he travelled to the agency's headquarters to give an address.
Mr Trump called the agency's handling of the Hillary Clinton email investigation "really disgraceful".
"We're going to rebuild the FBI," he said.
The leaked documents showed that top agents, one of whom was on the investigation into Mrs Clinton's email use, believed that a Trump presidency would be a bad result.
As Mr Trump addressed the graduates of the FBI National Academy programme, he pledged his unwavering support.
He said: "Anti-police sentiment is wrong and it's dangerous.
"Anyone who kills a police officer should get the death penalty."
During his campaign he pledged to sign an executive order demanding capital punishment for those who kill police officers, but he has not yet done so.
He claimed to be "more loyal than anyone could be" to police.
In his speech, the President promoted his tough-on-crime policies, and celebrated his decision to make it easier for local police forces to purchase surplus military equipment.
He also spoke about Michael Flynn, a former national security adviser sacked after admitting he lied to the FBI about conversations with Moscow's special adviser.
He said: "When you look at what's gone on with the FBI and the Justice Department, people are very very angry."
More from Donald Trump
He left the door open to the possibility of a presidential pardon for Flynn, but the White House said there was no plan to pardon him.
The President has always denied there was any collusion with Russia during his campaign for the White House.