On 24 June 2011, the day before what would have been their daughter Milly's 23rd birthday, Sally and Bob Dowler stood at the Old Bailey with their daughter Gemma to describe the "truly awful experience", "mentally scarring", cross-examination they had just undergone during the trial which led to the conviction of Levi Bellfield.

It had been, said Mr Dowler, a "mentally scarring experience on an unimaginable scale" to be forced to undergo intrusive and highly distressing cross-examination, before a jury found him guilty.

Eleven days later, Milly was again in the news. The Guardian revealed that in the days following her disappearance in March 2002, while her parents and sister still clung to the hope she might be alive, the teenager's voicemail was being accessed not only by detectives, but by reporters from the News of the World.

This was far from being the first revelation of illegal mobile phone hacking by News of the World reporters. It was almost exactly two years since the Guardian reported that "numerous" individuals had had their phones hacked by the News of the World. The Metropolitan police had reopened its investigation into hacking in January 2009, admitting it had uncovered new information about many more victims.

But while the public had been prepared to overlook the hacking of the phones of actor Sienna Miller and football pundit Andy Gray – both of whom had accepted payouts – a 13-year-old murder victim was another matter.

News of the World axed, Coulson and Brooks arrested

Britain was appalled, and Rupert Murdoch and David Cameron were under pressure. Their reaction was swift. On 7 July, the magnate stunned Fleet St by declaring that the next edition of the News of the World would be its last. The next day, the former NoW editor Andy Coulson, until recently the PM's director of communications, was arrested on suspicion of hacking and corruption, and the PM announced a public inquiry.

The final edition of the News Of The World newspaper on 10 July 2011. Rupert Murdoch closed the newspaper after the hacking scandal. Photograph: Richard Saker

In the five months until Lord Justice Leveson convened his inquiry, the scandal rocked the media, political and police establishment. Rebekah Brooks resigned as News International chief executive, and later was arrested over hacking allegations relating to her time as News of the World editor, along with other executives and former NoW journalists. The Met commissioner, Sir Paul Stephenson, and deputy police commissioner, John Yates, also resigned.

Scotland Yard tried to compel the Guardian to reveal the confidential sources of a number of its phone-hacking stories, but later abandoned the attempt amid press and public outrage. News Corporation withdrew its controversial bid to assume full ownership of BSkyB. And police arrested the first of what would become a number of reporters from the Sun over the alleged illegal payment of police officers for information.

Phone hacking victims give evidence

It was in this context, on 14 November, that Leveson took his seat in court 73 at the Royal Courts of Justice to begin his inquiry into "the culture, practices and ethics" of the press.

On day one, he heard from the Dowlers and Hugh Grant, both of whom had cause to complain about media treatment. The mixture of pitiable pathos and stardust they brought would be echoed throughout the inquiry, which would become cult daytime viewing on its live stream.

Sally Dowler, having been told by police that Milly's voicemail messages had been deleted by reporters, told a silent courtroom of the "euphoria" she had felt, believing this meant Milly was alive. Police later said they could no longer be certain whether journalists had purposely deleted the messages.

Grant's suggestion, however, that the Mail on Sunday might have hacked his phone was met the following day not only by a furious denial but by an enthusiastic monstering in the newspaper.

One by one, celebrities and civilians took the stand to give their accounts of their dealing with the press. Kate McCann said she had felt "like climbing into a hole" after the NoW published her personal diary, obtained from the Portuguese police, detailing her feelings after her daughter Madeleine disappeared.

Charlotte Church at the Leveson inquiry, where she talked about the 'psychological grind' she had endured since the age of 12. Photograph: Reuters

Sienna Miller said unexplained leaks to newspapers had left her in a state of "complete anxiety and paranoia". JK Rowling said she had been driven from her home by paparazzi. Charlotte Church said she been offered £100,000, or an agreement by NI papers to look upon her favourably, to sing at Rupert Murdoch's wedding when she was 13. She took the promise rather than the money. Christopher Jeffries, who was falsely insinuated by a number of newspapers to have been involved in the murder of the Bristol woman Jo Yeates, said he was forced to move "from safe house to safe house" to escape the press at the height of its attention.

The media is "like the mafia", the comedian Steve Coogan, one of the most outspoken celebrity critics, told the judge. "It's just business."

In defence of tabloid tactics

Other witnesses, however, mounted a robust defence of tabloid tactics. The former NoW reporter Paul McMullan was unashamed, declaring to the judge that "privacy is for paedos". "In 21 years of invading people's privacy I've never found anybody doing any good."

Giving evidence in the new year along with a parade of editors, Richard Desmond, the proprietor of the Daily Express, similarly failed to show much contrition over the paper's treatment of the McCanns, to whom it later paid a hefty settlement. "I apologise again to the McCanns etc etc etc," he said, but for all this talk of the 38 libellous articles the paper had printed, "you could argue there were 65 or 70 good ones".

Also in January, it emerged that 37 victims of hacking had reached settlements with News Group, including Lord Prescott, footballer Ashley Cole and the actor Jude Law, who received £130,000. The following month, surprising few, Rupert Murdoch announced that he would launch a new Sunday tabloid, the Sun on Sunday, to replace the defunct News of the World.

Police investigation widens

On 27 February, Leveson heard from Sue Akers, the Met deputy assistant commissioner in charge of the widening inquiries into hacking of phones and computers, and illegal payments to police officers. She told the inquiry that through "a culture of illegal payments" the Sun had established "a network of corrupted officials". The Met's investigation had widened, however, to include the Daily Mirror, Sunday Mirror, Daily Star and Star on Sunday titles, she said.

Paul Stephenson, the former Met Commissioner, told the court Boris Johnson's former deputy Kit Malthouse had complained to him "on several occasions" in early 2011 that the force was devoting too many resources to its phone hacking investigation.

In one of the more bizarre developments of the phone-hacking story, it emerged the Met had lent Rebekah Brooks a retired police horse called Raisa, which Cameron was later forced to admit to having ridden, neatly illustrating the questions over the propriety of their relationship.

Murdochs give evidence

But when it came to true box office draw, his lordship had saved the best until the spring. The courtroom was packed on 24 April for James Murdoch; by the end of the day, however, it was not he who was facing the hostile questions. In the most dramatic day of testimony to date, in what looked like a pointed act of revenge against the government, Murdoch junior released to the inquiry a clutch of emails revealing the intimate relationship between his own chief lobbyist Frédéric Michel and Jeremy Hunt the culture secretary responsible for adjudicating on the BSkyB bid, which led to calls for Hunt to resign.

The following day, however, Hunt successfully dodged the bullet, which instead struck his special adviser, Adam Smith, who resigned acknowledging that his activities in giving NI detailed updates on the progress of the bid "at times went too far". Hunt would later be promoted to health secretary.

Rupert Murdoch was next on the stand, in two days of gripping testimony during which the 81-year-old insisted he had "never pushed our commercial interests in our newspapers", called Gordon Brown "unbalanced", and insisted he hardly knew any politicians. Acknowledging the scandal was "a serious blot on my reputation", he said he wished he had shut the NoW "years before".

Rupert Murdoch told Leveson that Gordon Brown had responded angrily when he learned the Sun would support the Conservatives. Photograph: AFP/Getty Images

Over the following weeks, a succession of powerful and once-powerful figures were subjected to a public and, at times, exposing cross-examination by Robert Jay QC, lead counsel.

Andy Coulson made an understandably cautious appearance. He had been asked by Cameron about phone hacking only once, he said, but no one from the government had ever sought to benefit from his NI experience during the BSkyB bid. Pressed on the subject of his security vetting, which was less probing than that of his predecessors or successors, he acknowledged he may have been shown documents for which he did not have appropriate security clearance.

Rebekah Brooks told the inquiry she had discussed the BSkyB bid with George Osborne, and confirmed that she had socialised frequently with Cameron in Oxfordshire, where both live. They had exchanged texts around once a week, she said, and he had signed his "LOL", believing it meant "lots of love" (she later explained to the PM it meant "laugh out loud").

Tony Blair's appearance in May was interrupted by an intruder who declared that the former prime minister was a war criminal; he was greeted with alarm and anger by Lord Justice Leveson, and what almost seemed to be weary familiarity by the former prime minister. Rupert Murdoch was misunderstood, Blair told the inquiry. "He is not actually a sort of identikit rightwing person … you know, he has bits of him that are very anti-establishment …"

Cameron defends government handling of Sky bid

In June, the chancellor and prime minister both denied any improper contact with News Corp over the BSkyB bid. The suggestion of any deal to look favourably on the bid in exchange to the Sun's backing for the 2010 election was "complete nonsense" said Osborne.

David Cameron gives evidence at the Leveson inquiry.
Photograph: Enterprise News and Pictures

In his evidence, Cameron made clear his view that self-regulation of the press was not a viable future option, saying an independent regulator with "real teeth" was required. The relationship between politicians and the press had got too close, he acknowledged; in future there would be "a bit more distance, a bit more formality and a bit more respect on both sides".

Whatever the future relationship of prime ministers and press moguls, hopes of ongoing cordiality as publication of Leveson's report draws near may already have proved forlorn. Even before Cameron gave evidence, Leveson had felt the need to appeal to the Conservative party to continue supporting his inquiry, conscious that losing cross-party support for the process could be fatal.

Five months on, and the party is deeply divided, with scores of Tory MPs publicly calling for statutory regulation, while similar numbers publicly oppose it. In a startling show of impertinence, meanwhile, the education secretary, Michael Gove, last week roundly mocked Leveson's comments that he didn't "need any lessons in freedom of speech". The divisions between newspaper proprietors, victims and other interested parties are scarcely less stark.

"What I do not want is to produce a report that everybody reads, either likes or rubbishes, and then it just sits on a shelf, because then I've wasted a lot of time and we've all wasted a lot of money," Leveson commented to a witness early this year. We shall see.

• Inquiry recommends new regulator with statutory backstop• Politicians got too close to press owners• Hunt gave a 'perception of bias' in contacts with News Corp• Met criticised for failing to re-investigate hacking