"Police were initially advised the man was carrying a firearm, and attending officers were armed," they said in a statement tonight.
"The man was located by police with what appeared to be a firearm and he was shot once.
"The officers immediately administered medical attention and the man was taken by ambulance to hospital where he's reported to be in a serious but stable condition."
They said the students "were kept safe" throughout the incident.
"Police deal with dynamic and fast moving critical situations every day and our absolute priority is safety, in this instance the students and staff members.
"The officers involved are being offered every support."
The Independent Police Conduct Authority would be notified, police said.
Peterhead School nearby was also placed into lockdown for five minutes.
The lockdown at Flaxmere Primary was lifted just before 3.30pm.
TEACHER, KIDS, PARENTS REACT
Flaxmere Primary School teacher Phillippa Watson said it was "scary for the kids, but the kids were amazing".
The school intercom helped police communicate to everyone what to do during the lockdown, she said.
One pupil in one of the classrooms of the school described a frantic rush to shut the curtains, close the windows and lock the doors.
It was their last day of school for the year, the pupil said.
"We were just hiding and tucking ourselves in."
"We all thought it was fake because we do practices but then we heard the intercom say, 'it's not a drill' and we were like 'oh hell really'.
"Some people were really scared so others were saying "it's okay". Our teacher was saying "it's okay, just be quiet then you'll be safe"."
We heard the intercom again and our principal said "it's okay the police are here. I'm going to go over [to them] and go to all the classes to take them [the kids] out front.
Armed police were at the scene, with Whitby Cres, near the back of the school, cordoned off.
A police spokesperson said parents were advised to be patient.
A message to parents on the school's Facebook page about 2.30pm said: "We are on lock down. Please stay out of the school. All our kids are safe. Please stay. We are all hidden and OK.''
A school spokesperson commented on a local community Facebook page about 2.45pm:
"We are okay. Staff, kids and parents are all okay but still in lockdown. Going through a process and should be released soon."