A jury in the perjury trial of former News of the World editor Andy Coulson has heard a recording of evidence he gave during the trial of ex-socialist MSP Tommy Sheridan five years ago.

Coulson, 47, is accused of lying during the trial of Mr Sheridan in Glasgow in 2010.

At the High Court in Edinburgh today, the jury heard an audio recording of the testimony Coulson gave under oath after being cited as a witness in the case almost five years ago.

In the tape he was heard being questioned by Mr Sheridan, who conducted his own defence after dismissing his counsel.

Coulson, who gave his occupation as director of communications at Downing Street, was asked about his time as editor of the News of the World from January 2003 until January 2007, when he told Mr Sheridan that he stepped down after one of his reporters was convicted of phone hacking.

The jury heard Coulson on tape tell Mr Sheridan that he "had no knowledge" of it "but I felt I had to take responsibility for it".

Coulson said he employed a man named Clive Goodman but only became aware of Glenn Mulcaire when he was arrested.

He was recorded saying: "I stress that I never met, heard of, emailed, spoke to Glenn Mulcaire prior to when the Clive Goodman affair started."

Coulson said he did remember a company, Nine Consultancy, being on a list of those used by the newspaper and that it "was all legitimate work" they were paid for.

Asked if under his editorship the paper employed "corrupt police officers", Coulson replied: "Not to my knowledge. I had no knowledge of it happening."

The tape was played after the first witness, police constable James Smith, was called.

The 41-year-old was a court officer in Glasgow on December 9 and 10, 2010 when Coulson gave evidence at the High Court and identified him as the man sitting in the dock at today's trial.

Prosecutors allege that Coulson, from Kent, made false claims on December 9 and 10 after being sworn in as a witness at Mr Sheridan's perjury trial.

Among the claims, it is alleged Coulson falsely stated that, before the arrest of private investigator Mulcaire and News of the World journalist Goodman in 2006, he did not know that Goodman was involved in phone hacking with Mulcaire.

Coulson denies the allegations in the trial heard by Lord Burns, which is expected to last four weeks.

On the 2010 tape, Coulson said he only became aware of Nine Consultancy when he saw the name on a sheet when he was looking to reduce the newspaper's budget.

"Other than that I had no involvement with Nine Consultancy and certainly didn't know it was Glenn Mulcaire," he is heard saying.

The "legitimate work" carried out by the consultancy was "research work" and it was not something he instructed directly, Coulson told the 2010 trial. He later added that he had no need to question the details of the contract.

Coulson told the court five years ago that he resigned on the day Mulcaire and Goodman were sentenced.

Mr Sheridan asked him: "Do you accept it is hard to understand how it could be that while all those illegal activities were going on you didn't know anything about it?"

Coulson responded on the tape: "I decided to take responsibility for it and that's why I resigned. I didn't know about it. Things went badly wrong at the News of the World under my editorship and that's why I quit."

The jurors have already heard that following a series of articles about him in the News of the World, Mr Sheridan raised a defamation action in Scotland's Court of Session against the newspaper's publishers, News Group International.

The jury in the subsequent 2006 defamation action decided that the politician had been defamed by the newspaper and it was ordered to pay him £200,000 in damages.

The court also heard that Mr Sheridan's perjury trial at the High Court in Glasgow was in respect of evidence he gave in the earlier defamation action.

During the 2010 trial, Mr Sheridan called Coulson as a defence witness.

Today, the jury heard in the recording that Mr Sheridan asked: "Mr Coulson, are you denying that the News of the World in London ordered Glenn Mulcaire to intercept my phone illegally?"

Coulson replied: "I am saying that I had absolutely no knowledge of it and I certainly didn't instruct anyone to do it at the time or anything else untoward."