John Bolton, Donald Trump's former national security adviser, has pleaded not guilty to charges of mishandling classified information.

The 18 charges stem from allegations he shared or retained sensitive materials, including some characterised as top secret. He entered the plea after surrendering to authorities at a federal court hearing on Friday.

Bolton served during Trump's first administration but parted with the White House contentiously and has become one of the president's most vocal public critics.

The indictment makes Bolton, 76, the third of the US president's political opponents to face charges in recent weeks. Bolton has said he would defend his lawful conduct.

Wearing a dark blue suit and maroon tie, Bolton did not speak with reporters as he arrived at the courthouse in Greenbelt, Maryland. Not guilty, your honor, Bolton said in court. He was released on his own recognisance and a hearing in the case is scheduled for 21 November.

Prosecutors have accused Bolton of using personal messaging apps and email to illegally transmit sensitive information. These documents revealed intelligence about future attacks, foreign adversaries, and foreign-policy relations, prosecutors wrote.

Bolton said when he was charged that his actions were lawful conduct. He added he had become the latest target in weaponizing the Justice Department to charge those he [Trump] deems to be his enemies with charges that were declined before or distort the facts.

The indictment issued this week accused Bolton of sharing diary-like entries with two unnamed individuals, and using his personal email account to transmit messages with sensitive materials.

The indictment also states that between 2019 and 2021, Bolton was allegedly the target of a hacking attack from a cyber actor believed to be associated with the Islamic Republic of Iran that gained access to his account, exposing the classified materials.

Bolton's attorney, Abbe Lowell, noted, Like many public officials throughout history, Ambassador Bolton kept diaries – that is not a crime.

The records in question were described as unclassified, shared only with his immediate family, and known to the FBI as far back as 2021.

Bolton has faced scrutiny for his handling of classified information since 2020, when he sought to publish a book about his time in the first Trump administration. The Justice Department attempted to block the release, citing potential classified information, but a federal judge ruled against the government.

Trump has frequently criticized Bolton, labeling him a lowlife who should be in jail for allegedly releasing classified information in his memoir.