Police believe a riot between two rival gangs in Co Londonderry was organised over the internet.
Officers were attacked by a mob of up to 100 youths who hurled bricks, bottles and other missiles as they tried to deal with the disturbance in the Academy Street area of Rosemount on Friday night.
Violence broke out at about 10.15pm after a row between two individuals escalated when their friends intervened.
Police said they are investigating claims that trouble was orchestrated through social networking websites.
Four teenagers were arrested for public order offences as large crowds gathered in the Rosemount area. They were later released, pending further reports.
A PSNI spokesman said at least one police vehicle had been damaged during the disturbance.
There were no reports of any injuries.
Meanwhile, in a separate disturbance in Co Armagh police were pelted with stones and bottles as they tried to arrest two men in connection with an armed robbery.
Trouble broke out in the Drumbeg area of Lurgan on Saturday night after officers tried to arrest the men aged 17 and 23-years-old.
There were no reports of any injuries as a result of the trouble.
At about 8pm on Saturday two men, wearing balaclavas and carrying handguns robbed premises at Taghnevean Walk in Lurgan.
They forced staff to hand over a sum of cash and cigarettes before making off on foot.
Two imitation handguns and a quantity of stolen property were recovered by police at Drumbeg.
A police spokesman also appealed for four customers in the shop at the time of the robbery to come forward.
They are also keen to speak to a motorist who stopped with police on the Tandragee Road at about 8.15pm. The two men aged 17 and 23 were last night charged with armed robbery and are due in court this morning.