A former Metropolitan police officer who sold information to the Sun about the Duchess of Cambridge, former footballer Paul Gascoigne, Tetra Pak heir Hans Rausing and a 15-year-old girl who died after taking drugs was jailed for two years in March, it was revealed on Wednesday.

The court heard that Paul Flattley had been on the force barely a year when he started the “sustained” provision of confidential information to the News International newspaper, which earned him a total of £7,600.

The officer, who was on the Met’s rapid response team in Kensington and Chelsea, was imprisoned in March after he pleaded guilty to misconduct in public office but, for legal reasons, his crime could not be reported at the time. Over three years, from 2008, he contacted the paper 39 times, although the court heard that not all communication resulted in published articles.

Flattley established a mutually beneficial relationship with Sun journalist Virginia Wheeler, emailing or texting about incidents almost immediately after they had happened or helping to answer the paper’s questions about royals or celebrities in the borough. For a good tipoff, he could earn £750.

His jailing could be reported for the first time on Wednesday after the Crown Prosecution Service (CPS) announced it had decided to drop charges against Wheeler on medical grounds.

Prosecutor Mark Bryant Heron told Southwark crown court that he had asked the attorney general for “nolle prosequi”, which is permission to drop the Wheeler prosecution. However, Wheeler’s QC, James Wood, told the court she would have vigorously contested the charges if the prosecution had gone ahead.

At the sentencing, Mr Justice Fulford said Flattley did not care what effect his activities would have on the individuals whose privacy he invaded and that he was “simply motivated by personal profit from the sale of what he, no doubt, believed was a good story”.

In mitigation, Flattley’s barrister said his client passed on “fairly low order” information and had offered to give evidence for the prosecution in a trial of the journalist. He said Flattley, who was awarded the baton of honour for being the outstanding officer of his intake, was full of shame and regret and wished to apologise to those whose personal details he passed on.

Flattley joined the force as a special constable in 2005 and became a PC in 2007. He was regularly called to incidents involving celebrities, footballers, politicians and protesters, ranging from minor traffic misdemeanours – Rausing had failed to stop at a red light – to those involving fatalities.

The court heard how he “developed on eye for celebrity stories” on his patch, making his first contact with the Sun in 2008 when he tipped off a reporter that Gascoigne, who has battled with addiction for years, had been sectioned by police. Flattley claimed this was because he was concerned about the star and wanted to draw attention to his plight.He went on to sell stories about Zara Phillips, politician Ann Widdecombe, footballer Jack Wilshere and others who called the emergency services or were involved in incidents in the west London borough.

One day when he was off duty, the paper phoned to see if he could confirm rumours that the Duchess of Cambridge, then Kate Middleton, was engaged to Prince William.

He telephoned his former sergeant, then on Middleton’s protection team, to ask if they knew of a pending royal engagement. He texted the reporter to say he would “get one of our lads to do a few passes by her place” that day to “see if there were any extra old bill” on duty, which might indicate an imminent announcement. The engagement was announced weeks later.In another incident, Flattley told the paper that singer Mika’s sister had fallen from a third-floor window, texting the reporter to say the woman was critically ill, adding “Mika was there too, any good?”. The reporter replied: “Yes definitely, know if it was suicide attempt or accident?” and “Do you know how high the building?”. For his assistance on this story, he earned £750.

Detective Chief Superintendent Gordon Briggs, the senior co-ordinating officer for the Met’s Operations Weeting, Elveden and Tuleta, condemned Flattley’s behaviour. “Paul Flattley did not come on duty to serve the public; he came on duty to exploit them. He deliberately leaked information on 39 occasions, earning himself a total of £7,600 in corrupt payments from the Sun newspaper.

“Flattley abused his privileged position as a police officer and the stories he sold had nothing to do with whistleblowing or the public interest. At the very time his colleagues were dealing with families whose relative had died or been horrifically injured, Flattley was callously selling information about them to a newspaper. He let down both the public he was paid to serve and his colleagues.”

Flattley also tipped off the same Sun reporter about another case in which Isobel Jones-Reilly, 15, died after taking ecstasy she found in a university lecturer’s drugs stash during a party at a friend’s house in north Kensington.

The court heard Flattley had been on duty for 10 minutes when he texted the paper, divulging the girl’s address, that she had been pronounced dead and revealing that the house in question “would be a crime scene for some time”. “One girl dead, one critical, one stable one missing,” he texted. “This could be as big as the Leah Betts tragedy”.

In an impact statement read out in the court, Isobel’s mother said she was shocked to learn about Flattley. “It’s very hard to comprehend that anyone would see fit to provide information to a journalist about our child for monetary gain,” she said. “We expect our police to be beyond reproach as they hold a position of trust. We were powerless after Isobel’s death … this has compounded our suffering and distress.”Fulford said the attitude revealed in the communication with the Sun reporter about people who were in his professional care was utterly reprehensible and an abuse of his public office.

Flattley is the fourth police officer to be jailed as part of the Operation Elveden investigation into alleged corrupt payments to public officials from newspapers for stories. He has received the heftiest sentence so far for activities which the Met said had a corrosive effect on the public confidence in the police.

The Sun also benefited from a tipoff about Edward Woollard, an A-level student who was arrested in 2010 for throwing a fire extinguisher from the roof of the Conservative party headquarters in Millbank during the tuition fees riot.

Flattley told the Sun journalist that Woollard was in custody in Belgravia, central London, and gave the paper heis home address unlawfully.

Some of the contacts concerned rumours that turned out not to be true about people including Widdecombe, whom the paper heard had been arrested for drink driving. “I checked out all our systems there is no record of it in our systems,” Flattley told the Sun, which paid him £100 for his help.

Gregor McGill, a senior lawyer with the CPS, whose team handles potential prosecutions in relation to the ongoing phone-hacking investigations and other related matters, said the case against Wheeler was dropped following expert medical evidence relating to her health.

“In accordance with the code for crown prosecutors, which requires prosecutors to keep all cases under continual review, following receipt of further expert medical evidence relating to her health, the CPS has concluded that it is no longer in the public interest to prosecute Virginia Wheeler,” he said.

“Proceedings against Ms Wheeler were commenced on 22 January 2013 by way of summons for an alleged offence of conspiracy to commit misconduct in public office. The proceedings against Ms Wheeler have now been concluded.”

• To contact the MediaGuardian news desk email media@guardian.co.uk or phone 020 3353 3857. For all other inquiries please call the main Guardian switchboard on 020 3353 2000. If you are writing a comment for publication, please mark clearly “for publication”.

• To get the latest media news to your desktop or mobile, follow MediaGuardian on Twitter and Facebook