A former FBI Agent in Minnesota who admitted leaking classified internal documents to a reporter was sentenced Thursday to four years in prison.

Terry James Albury, 39, plead guilty in April to one count each of unauthorized disclosure of national defense information and unauthorized retention of national defense information. He appeared to cry in court and took several moments to compose himself as he read a statement before he was sentenced.

“I truly wanted to make a difference and never intended to put anyone in danger,” Albury said, his voice wavering. He took responsibility for his actions and apologized to the people he hurt.

Prosecutors said Albury betrayed public trust when he stole more than 70 documents, including 50 that were classified. The information he shared with an online news organization included a document classified as “secret” that related to how the FBI assesses confidential informants.

Albury’s defense attorneys had asked for probation, saying he acted patriotically and was morally conflicted by the FBI’s counterterrorism policies that he viewed as racial profiling.

Albury told the court that he joined the FBI with a “sincere desire to serve, protect and make this world a better place,” but that over time, he believed some of the FBI’s counterterrorism policies were a detriment to national security. Albury, who is black, also felt isolated as a minority in the FBI.

“I now recognize there were other avenues, and wish I would’ve trusted the FBI’s internal processes for addressing my concerns,” Albury said.

Albury was not taken into custody and will be allowed to self-report to authorities after he is given a prison assignment. He and his attorneys had no comment as they left the courthouse.

The Trump administration and Attorney General Jeff Sessions have made prosecuting government employees who leak sensitive information to the media a priority. Sessions said last year that the Justice Department had more than tripled the number of active leak investigations since President Barack Obama left office.

Albury was accused of sharing documents with an online news organization. One document, dated Aug. 17, 2011, related to how the FBI assesses confidential informants. The date of that document and its subject matter corresponded with a Jan. 31, 2017, story on The Intercept.