Unnamed photographers banned from pursuing star in the street or loitering outside his London home
The 19-year-old asked the high court to intervene after trying to persuade the photographers to change their behaviour, according to his lawyer.
The order prevents unnamed photographers from pursuing Styles by car or motorcycle, placing him under surveillance or loitering within 50m of his London home.
"This is not a privacy injunction," the singer's lawyer, David Sherborne, told the high court in London. "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."
Sherborne said the case concerned a series of paparazzi photographers, four of whom were in the process of being identified.
The injunction against "Paparazzi AAA and others" will remain in place until the new year, when the judge Mrs Justice Nicola Davies will decide how the action should proceed.
Styles, who shot to fame in 2010 after auditioning for the X Factor, was not in court for the short hearing on Monday morning.
The injunction places the One Direction singer among a handful of stars who have asked the high court to settle their skirmishes with the paparazzi. The singer Cheryl Cole won a similar high court order last year after complaining about the "intense and very annoying" experience of photographers camping outside her home. In 2011 Tinglan Hong obtained an injunction against the paparazzi to deal with the sudden interest in her private life after she gave birth to Hugh Grant's daughter.
According to Gideon Benaim, a media lawyer at Michael Simkins LLP, celebrities can be left with little choice but to take their grievance to the high court because the Press Complaints Commission (PCC) is "limited" in its powers.
"Photographers are not signatories to the PCC so the PCC can't adjudicate against them but the PCC can inform newspapers that a specific person does not consent to being approached or hounded," he said. "Ultimately newspapers and magazines pay for photographs of this nature so some of the blame lays with them. Everyone, including people in the public eye, should be entitled to live without persistent harassment and intrusion."
Paul Tweed, a media lawyers whose clients have included Britney Spears and the Duchess of York, said he had witnessed a "dramatic increase" of complaints from public figures about relating to photographs taken of their children.
"The only options available are the PCC and injunctions," he said. "Once the PCC come in it's too late. Injunctions are going to become more commonplace because they can stop the harassment but, for privacy, often the horse has bolted."
However, the freelance photographer Charlie Pycraft had little sympathy for celebrities such as Styles who actively court publicity on Twitter and other social networks.
"If you're putting it out there on Twitter, you are exposing yourself," he said. "They're invading their own privacy 24/7 so why shouldn't someone else? What right do they have to lecture on privacy?"
He added: "I think it's an abuse of the law because these laws were set up for people being harassed and stalked when their lives are in danger. It's a misuse because they are not really being harassed – they are inviting it."
Legal experts agree that the UK is unlikely to introduce anti-paparazzi legislation like that signed into law in California in September. That legislation, championed by actors including Halle Berry, increases penalties on anyone attempting to record or photograph a child because of the identity of their parents in a manner that "seriously alarms, annoys, torments, or terrorises" them.
guardian.co.uk © Guardian News and Media Limited 2010
image: © BrittneyATambeau