Geoff Smith has been stationed at St Mungo's Academy in Glasgow's east end for more than three years and has found modern communications technology makes arranging gang fights easy.
"Pupils produce their own website where they put up a chat page and talk to each other. They'll say: 'Meet at 11. I'm going to give you a doing.' They are using the skills they learn in school.
"You learn that they don't hate each other it's the opposite. They organise fights like other kids might organise football matches."
One site PC Smith uncovered, created by a gang leader and pupil at St Mungo's, showed the boy wielding everything from imitation firearms to stolen police batons. "We raided his house and got a lot of stuff out of it, and shut the site down," said PC Smith.
The police have to be on red alert as new sites are constantly springing up, and the current social networking craze makes it even easier to arrange battles via cyberspace.
PC Smith, however, reports considerable success in tackling gang violence at St Mungo's. He was one of dozens of experts from around the world who gathered in Fife last week for a World Health Organisation conference, arranged in conjunction with Scotland's Violence Reduction Unit.
At St Mungo's, around five gangs remain, but they aren't a dominant force. Attendance has risen dramatically, with the school among the top five in Glasgow. School uniform has been embraced, with blazers added at the pupils' behest. "You've now got this school in the east end of Glasgow where the pupils look fantastic, like one of the top schools in Scotland," PC Smith said.
It is not just St Mungo's that appears to have benefited from the initiative: another consequence of PC Smith's presence is an increase in the number of pupils applying to join the police. In the 20 years before he joined the school, only one pupil applied; last year, there were more than 30 applications.
There are more than 20 school-based police officers in Scotland. Most are in Glasgow, but they can also be found in Edinburgh, East Renfrewshire and even Rothesay Academy. "My role is to challenge behaviour within the school and break cycles of violence so it's safe to be there," PC Smith told the Fife conference.
At one time, gangs of up to 200 youths armed with golf clubs, bottles and bats would do battle on the doorstep of St Mungo's virtually every day, he said.
Riot police had been brought in they'd even tried using the mounted branch. "Putting a police officer in the school was a last ditch effort to find something that would work," said PC Smith.
When he joined St Mungo's, the then headteacher didn't want him there, he said. But he proved his worth after identifying the gangs nine in total and their members and pursuing the leader of the biggest one: the Real Calton Tong.
"Everywhere he went, I followed," said PC Smith. "If he went to the chip shop at lunch time, I'd be 10 yards behind him. Soon, his following started to drift away the last thing they want is to be followed by a cop all day long."
Under PC Smith's instigation, school uniforms were introduced. "We had to know who was supposed to be there," he said. And restorative justice was brought in as the principal means of resolving conflict.
Good behaviour was rewarded. Instead of taking gangs on outward bound courses to try and get them to change their ways, he targeted the youngsters they bullied. "Gang diversion is a reward for bad behaviour," he stated emphatically.
According to PC Smith, it was easy to spot the potential victims in the playground: the lanky girl with the braces and the big feet, the boy with the ginger hair and glasses. "We created a gang out of the victims; suddenly they had a peer group," he said. "And it meant the bullies couldn't work."
PC Smith has also begun targeting children in St Mungo's five feeder primaries, and even those at nursery. "Once a gang member has been involved from the age of eight until they are 12, 13 or 14, they are really enjoying it," he said. "We can't change the attitude of the gang leaders, but what about their younger siblings?"
Children as young as six can be drawn away from gangs, PC Smith suggests, if determined efforts are made to get them to invest their energy and time in something else.