SYDNEY — An Australian politician says he has learned a valuable lesson in social networking after he "liked" a Facebook photo without realizing that it showed a teenage prankster exposing himself.

Western Australia Minister for Education Peter Collier said he clicked the "like" button under what he thought was an innocent photo of the then-16-year-old in late 2011. Collier apologized Thursday and said he had no idea that the teen, who was otherwise fully clothed and posing alongside an older man, was playing a prank commonly known as "sneaky nuts."

"At first glance it appeared to be a harmless picture," Collier said in a statement. "It was a silly mistake on my part. I only became aware of the actual content of the photo when shown by a journalist today. This obviously highlights the pitfalls of social media. I apologize if I caused any offense."

The stunt was popularized by Australian comedian Chris Lilley's TV show "Angry Boys," in which a character revels in ruining group photos by secretly exposing himself. The prank has been a headache for some educators: Last year, administrators at a Catholic school in Canada scrambled to place stickers over a photo printed in all 1,300 class yearbooks of a student subtly exposing his genitals.

The Australia incident did not attract attention until late last month, when the teen bragged on Twitter about fooling Collier, whom he was friends with on Facebook.

Also on HuffPost:

Loading Slideshow...
  • Oops! Accidental Porn

    This woman said she found a box of porn... on VHS. So she made the logical decision of <a href="http://www.huffingtonpost.com/2013/03/07/jeanette-ellis-vhs-porn-door-to-door_n_2829094.html?utm_hp_ref=weird-news">trying to go door-to-door to sell them.</a> Not everyone was pleased.

  • Oops! Accidental Porn

    In Tucson, Ariz. <a href="http://www.nydailynews.com/news/national/fbi-busts-ex-cable-company-employee-hacking-2009-super-bowl-broadcast-porn-clip-article-1.136178">Comcast Cable accidentally aired 37 seconds of porn during Super Bowl XLIII</a> on February 1, 2009 when the Arizona Cardinals played the Pittsburgh Steelers.

  • Oops! Accidental Porn

    In April, 2001, <a href="http://metro.co.uk/2011/06/16/shocked-shoppers-in-dresden-assailed-with-porn-on-malls-special-offers-screen-46024/">shoppers in a Dresden, Germany supermarket were shown a sex channel</a> on a big screen meant to show daily specials after hackers breached the system.

  • Oops! Accidental Porn

    In February, 2012, a British radio station aired a recording of what sounded like <a href="http://www.pinknews.co.uk/2012/02/20/radio-station-aired-five-minutes-of-gay-porn/">"two British men in a mostly wordless, but fairly graphic, exchange."</a>

  • Oops! Accidental Porn

    A Northern Irish priest sparked a local uproar after <a href="http://www.bbc.co.uk/news/uk-northern-ireland-17582542">accidentally displaying a series of X-rated photos</a> to a group of parents during a primary school meeting in April, 2012. He was asked to take a sabbatical leave from the priesthood during the investigation.

  • Oops! Accidental Porn

    While a TV news anchor reported a segment on Syria to a national audience in early January, 2013, <a href="http://www.thelocal.se/45468/20130107/#.UQgCIkqLxTF">porn mistakenly aired in the background for a full 10 minutes.</a>

  • Oops! Accidental Porn

    Preschool children (not pictured) in Normandy <a href="http://www.google.com/hostednews/afp/article/ALeqM5iIBaDacLPEK1arh9NE9MFKLP2TkQ?docId=CNG.302a0b2b604bce939a090535479108e1.911">were left unsupervised to watch a porn film</a> after the teacher thought she had downloaded a cartoon but clicked on the wrong file. Unaware of her mistake, the teacher exited the classroom before the clip began, and the hardcore film played for several minutes. (January, 2013)

  • Oops! Accidental Porn

    Twitter's newest feature, Vine, which allows users to record 6-second videos, has quickly <a href="http://techcrunch.com/2013/01/27/twitters-vine-has-a-porn-problem/">developed a porn problem</a>.