Australian media companies could be liable for third-party comments made on their social media posts after the High Court upheld a ruling on a case by a formerly imprisoned teen who sued media companies over comments about him.

The decision on Wednesday creates a precedent applying to Australian media companies, which potentially makes them liable as publishers of comments from other social media users as though they made the statements themselves.

The ruling comes after an appeal by Nine Entertainment and News Corp in relation to the case of Dylan Voller, who in 2016 was filmed suffering cruel treatment in a Northern Territory prison.

The footage posted by the Australian outlets attracted comments which he claimed were defamatory sparking a four-year legal battle against the Australian, Sydney Morning Herald, and Sky News Australia.