Police said a 35-year-old man was being treated for injuries in hospital following the “targeted attack”.
They said he was in a stable condition and confirmed that no other person was injured or hurt during the incident.
The gunman is understood to be on the run.
Firearms’ officers attended and extensive enquiries are ongoing in the area surrounding the school to establish the exact circumstances.
Chief Inspector Simon Jeacocke said: “This is a highly unusual incident and understandably, parents, staff, pupils and people in the local community are all very alarmed by this.
“We do believe it was a targeted attack but nonetheless this took place near to a local primary school at the start of the school day, when the area was busy with parents dropping off their children.
“Although it would appear that there was an intended victim, anyone could have been injured as a result, putting young children and innocent people at risk.
“The pupils are now safe at school and additional police patrols are in the area to provide extra reassurance over the next couple of days.
“Please do not hesitate to approach my officers if you are concerned at all.
“Detectives are carrying out enquiries to establish the full circumstances of the incident and are keen to appeal to anyone who may have seen the incident or who had been in the area at the time to contact police on 101 with any information.
“Alternatively call Crimestoppers on 0800 555 111, where anonymity can be maintained.”