A three-month-long drugs trial costing $1m (£485,000) has been abandoned in Australia after it emerged that jurors had been playing sudoku for almost the entire duration of the hearing.

Sydney district court judge Peter Zahra discharged the jury on Tuesday after the foreperson admitted she and four or five other jurors had been passing the time by playing the numbers game.

"It helps me keep my mind busy, and pay more attention. Some of the evidence is rather drawn out and I find it difficult to maintain my attention the whole time, and it doesn't distract me too much from proceedings," the jury foreperson said after being questioned by the judge.

She admitted some of the jurors had photocopied sudoku game sheets to play during the trial and had compared results during meal breaks.

The accused, two men who were facing possible life sentences on drugs manufacturing and firearms charges, spotted members of the jury playing the puzzles. While one of the accused was giving evidence, he noticed the jurors were writing vertically and not horizontally. The second accused man saw the same thing.

Robyn Hakelis, a lawyer for one of the defendants, alerted the judge and asked for the case to be abandoned.

"We were informed early on Monday of last week that it was happening in the jury box and then I made observations, sort of took notes, to watch what was happening," Hakelis told reporters.

"They were writing in all different directions and I thought, 'they're not taking notes like we thought they were'.

"Everyone assumed they were taking notes."

About 105 witnesses, including 20 police officers, gave evidence during the trial which started on March 4. The prosecution and defence had been due to start summing up this week.

Zahra, who had previously congratulated the jury for its apparent attentiveness, told the foreperson the sudoku players had let down their fellow jurors and everyone involved in the trial.

No action will be taken against them, but the New South Wales sheriff's office will now update its guidelines informing jurors that it is unacceptable to play games in court.

The Director of Public Prosecutions said it would recommence proceedings against the co-accused and another trial would be held at a later date.