A Corrections officer was followed and shot at in the Whanganui Prison carpark.
Shots were fired at the officer's car around 9pm on Wednesday.
Corrections Association president Alan Whitley said the man was not hurt in the shooting.
He said two people are in police custody.
"A staff member on their way to work ended up being followed the road leading down to the prison and on the prison property shots were fired at his vehicle."
Whitley said the police are investigating and details are still emerging.