A man has narrowly avoided jail after an online party prank backfired, with the episode serving as another cautionary tale about the risks of misusing social media.

What the man thought would be a harmless Facebook hoax led to police intervention and the prospect of jail time when he was charged with stalking two years later.

The drama began after Michael Davis, then 17, used Facebook in August 2010 to advertise falsely that a party was being held at the home of a rival teenager.

He created the Facebook event with an account he set up in the name of Tom Fletcher, the front man of the English pop band McFly.

Within days, thousands of people had accepted the invitation, forcing the family of the targeted teenager to contact police, who warned via local media that those who turned up would be charged with trespassing.

Some teenagers did show up and one of Mr Davis’s friends copped a $200 fine for going to the address.

For a while that appeared to be the end of the story. But two years later, Mr Davis was charged with stalking under the Crimes Act, with police alleging the hoax had drawn unwanted attention to the targeted teenager and his family, who had feared for their safety.

Police had tracked the ISP address used in the prank to Mr Davis’ home computer, despite him not having returned to the Facebook page since creating the hoax.

His solicitor Will Parker of James Dowsley & Associates said he was puzzled as to why it took police two years to lay charges. The delay meant that, although the hoax was perpetrated when Mr Davis was a minor, the matter was sent to the Magistrate’s Court because he had since turned 19, putting him at risk of a harsher penalty.

Ultimately, he was put into the Criminal Justice Diversion Program, an option for first-time offenders, avoiding jail. He agreed to write an apology to the teen and to police, donate $400 to beyondblue and serve a four-month good behaviour bond.

“I thought it would just be a house party, cops would rock up and that would be the end of it,” Mr Davis, now 20, said, adding a warning: “Don’t mess around with that sort of stuff. It’s just not worth it.”

Mr Parker said a key issue in the case was whether creating a false party qualified as stalking.

To qualify, there must be multiple acts of stalking that place the targeted person in fear. Mr Parker said it was questionable whether a reasonable person would have become fearful in this situation.

Even though Mr Davis simply created the prank Facebook event, the court viewed the involvement of others as multiple acts on his behalf, via their contact with the Facebook page and their attendance at the address.

Aliyah Stotyn writes for The Citizen, thecitizen杭州夜生活.au

The original release of this article first appeared on the website of Hangzhou Night Net.