LONDON — Andy Coulson, a former senior editor in Rupert Murdoch’s news empire and a onetime adviser to Prime Minister David Cameron, was sentenced on Friday to 18 months in prison for his part in the phone hacking scandal that convulsed Britain’s press, police and political elite and inspired calls for tighter regulation of journalists.

After a trial that spanned almost eight months, Mr. Coulson was found guilty last week on a charge of conspiring to intercept phone messages. Five other defendants who, like Mr. Coulson, had denied the charges were acquitted. They included Rebekah Brooks, the former chief executive of Mr. Murdoch’s British newspaper subsidiary and Mr. Coulson’s onetime lover.

Reporters in the courtroom on Friday said Mr. Coulson displayed no emotion when the sentence was read out. If he is given time off for good behavior, he could be paroled after serving half of his sentence. Standing alongside him in the courtroom were four other people involved in the hacking scandal who had admitted their part in the scandal earlier in the trial and who were sentenced to up to six months.

Mr. Coulson, who edited Mr. Murdoch’s tabloid The News of the World from 2003 to 2007, and the newspaper’s former royals editor, Clive Goodman, also face a retrial on separate charges of making illegal payments to police officers in return for two royal telephone directories. Prosecutors called for the retrial after the jury failed to reach a verdict on those charges.