The reported sentence imposed on Bolton, a 78-year-old veteran diplomat, followed prosecutors’ request for a five-year prison term. His defence lawyers had asked Judge Theodore Chuang to avoid jail and instead impose a suspended sentence at the hearing in Greenbelt, Maryland.

“Mr Bolton, with your years of public service... you know that this conduct was not only unlawful but jeopardized the national security of the United States,” CNN quoted Chuang as saying during the sentencing hearing.

Bolton was indicted in October last year on 18 counts of transmitting and retaining top-secret national defence information. He pleaded guilty in June to a single count of unlawfully retaining classified information under a plea agreement that also required him to pay a $2.25 million fine and forfeit his federal pension.

Trump welcomed the prison sentence in a Truth Social post, calling his former aide a “total sleazebag.” “He did not serve our Country well and, when you don't, this is what should happen!” Trump wrote.

Former Vice President Mike Pence was among those seeking leniency for Bolton. In a letter to Chuang, Pence described him as a patriot who had devoted his life to the country and expressed hope that Bolton’s years of service in senior positions would weigh heavily in favour of leniency.

Bolton served as Trump’s top security adviser for about a year and a half during the president’s first term. He has since regularly criticised Trump on television and in print, calling him “unfit to be president.” Trump withdrew Bolton’s security detail shortly after returning to office in January last year.

The case was described as one of several criminal cases involving prominent Trump critics since the Republican president returned to the White House. The Trump Justice Department has also pursued cases against New York Attorney General Letitia James and former FBI director James Comey.

Comey was indicted in April on allegations that he threatened Trump’s life, five months after an earlier case against the former FBI chief was thrown out. The allegation stemmed from an Instagram post showing “86 47” spelled out in seashells on a beach; Trump has alleged that “86” is slang for kill and “47” refers to him as the 47th president.

The case against James, which has since been dismissed, centred on an allegedly falsified mortgage application. Unlike the James and Comey cases, the investigation into Bolton’s alleged mishandling of classified material began during Joe Biden’s administration. Some of the material was allegedly later used in Bolton’s book, The Room Where It Happened, which was highly critical of the Trump administration.