The What Makes You Beautiful hitmaker filed his case in London's High Court after a number of snappers failed to take heed of his personal requests for them to stop following him voluntarily.
The court ban was granted last week (ends13Dec13), but only became public on Monday (16Dec13). The legal manoeuvre stops photographers in Britain from chasing the singer by car or motorcycle, placing him under surveillance and waiting within a certain distance of his home to track his movements.
The order will remain in effect until January (14), when a judge will decide how to proceed.
Although the injunction protects Styles from overzealous shutterbugs, it still allows fans to approach the singer.
His lawyer David Sherborne told Mrs Justice Nicola Davies, "This is not a privacy order. Mr Styles is not trying to prevent fans approaching him in the street and taking photos.
"He remains happy to do that, as he always has. Rather, it is the method or tactics which have been used by a certain type of photographer."
The One Direction boys have become hot paparazzi targets since rising to fame on Britain's The X Factor reality show in 2010 and Styles isn't the first member to complain about his encounters with the press - last month (Nov13), Niall Horan was involved in an incident with snappers at Los Angeles' Lax airport, where he was reportedly dragged to the ground by a photographer.