Andy Coulson, British Prime Minister David Cameron's former media chief, is sent to prison for 18 months for encouraging phone-hacking by journalists of the now defunct News of the World. (Reuters)

Andy Coulson, Prime Minister David Cameron’s former top aide, was sentenced to 18 months in prison Friday for his role in a phone hacking scandal during his editorship at the Rupert Murdoch tabloid News of the World.

As the final chapter in the long-running phone hacking trial drew to a close, Cameron’s critics said the trial — one of the biggest in British history — highlighted the prime minister’s poor judgment in hiring Coulson, once one of his most trusted advisers.

“It throws up very serious questions about David Cameron’s judgment in bringing a criminal into the heart of Downing Street despite repeated warnings,” said Ed Miliband, leader of the opposition Labor Party.

Responding to the sentencing, Cameron said, “What this says is that it’s right that justice should be done and that no one is above the law.”

Coulson, 46, was found guilty last week after a marathon eight-month trial stemming from revelations that journalists at News of the World hacked into the phones of royals, celebrities and ordinary Britons in search of scoops.

The scandal rocked the British establishment and resulted in the closure of the News of the World, then Britain’s biggest-selling newspaper.

Cameron, who is facing a national election in less than a year and whose Conservative Party is behind in opinion polls, has said that Coulson had assured him that he had no knowledge of phone hacking, and that he believed him.

Critics have accused the prime minister of ignoring repeated warnings about Coulson, and for not vetting him thoroughly before hiring him as his director of communications.

Coulson resigned as editor of News of the World in early 2007 after a so-called rogue reporter at the paper was found guilty of phone hacking. Coulson maintained that he took ultimate responsibility but was not involved. Cameron hired him a few months later.

Judge John Saunders said Coulson had to take a “major share” of the blame for phone hacking, which he said flourished under Coulson’s editorship and was used to gain a “competitive edge.”

Coulson was sentenced alongside four other defendants who had previously pleaded guilty. Greg Miskiw, former news editor, and Neville Thurlbeck, former chief reporter, were jailed for six months each. James Weatherup, a former reporter, received a four-month suspended term. Glenn Mulcaire, a private investigator, received a suspended sentence of six months.

The legal storm is not over for Coulson. Earlier this week, prosecutors announced that they are seeking a retrial for Coulson on separate charges related to the paying of police officers for access to royal phone books.