The man police shot dead after he took a woman hostage at gunpoint at a Taranaki Hotel overnight was released from jail last week.
Police this afternoon named him as Anthony Ratahi, 46, from Stratford.
This morning, police shot him dead at the Headlands hotel in Opunake, 65km south of New Plymouth, after he took a woman, believed to be his ex girlfriend, hostage last night.
Ratahi was released from jail on July 6 after serving eight weeks, Corrections Department community probation services general manager Katrina Casey said in a statement.
"There was no requirement for the involvement of corrections after his release," she said.
The department would not disclose what Ratahi had been jailed for or the total length of his sentence.
He had reportedly been charged previously over assaulting a woman.
Prisoners are required to serve only half of a sentence that is less than two years. A judge determines whether any release conditions are imposed.
Acting District Commander Pat Handcock told media this afternoon he went armed into the restaurant at the Headlands hotel where there were about 10-16 patrons, about 10.45pm.
He produced a hand gun to a woman he knew, who worked at the restaurant, and shouted at patrons to leave.
"He then barricaded himself into the building holding the female victim hostage and negotiations between police and the man continued on and off throughout the night, mainly by telephone," Mr Handcock said.
"The man remained agitated and uncooperative throughout this event."
He stepped outside the hotel about 10.20am.
Mr Handcock said police challenged him, deployed a police dog and "there was a struggle prior to the discharge of a police firearm".
But as it was "very early" in the investigation, he was not prepared to discus the details and circumstances of the shooting.
Ratahi died at the scene.
The police shot was the only shot fired, Mr Handcock said.
A knife was found near his body, he said.
The gun had not been found.
The hostage, a 30-year-old woman, suffered minor injuries during her ordeal. She was checked by ambulance staff and did not require hospital treatment, he said.
Police would be talking to her at length to ascertain what happened, he said.
Three investigations had been launched following the man's death, Mr Handcock said.
One team of police would focus on what happened last night and the actions of the deceased.
An independent investigation would look the circumstances of the police shooting.
Another investigation would look at police policies and procedures.
Detective Superintendant Andrew Lovelock of Auckland would oversee the investigations and police had contacted the Independent Police Conduct Authority who had appointed an investigator, Mr Handcock said.
"It is required by law that we complete three separate investigations. This ensures the integrity of the police process is protected and remains transparent an the public is kept appropriately informed."
The hotel would remain under police cordon for a day or two, while police conducted a full scene examination, he said.
Police would also take statements from witnesses.
The deceased was known to police, but he would not go into details because of the ongoing investigations, he said.
About 20-25 police, including members of the special tactics group form Auckland and armed offenders squad from New Plymouth, attended the incident overnight.
Eyewitness reported seeing the woman beaten as the man dragged her from the restaurant.
Kathy Muggeridge was dining at the restaurant when a gunman burst in.
She said she had gone to pay when she noticed the chef on the phone.
"I immediately thought something was up just by looking at him and that was when the guy pointed the gun at everyone in the restaurant and told us to get out. He was yelling at us to get out and I just yelled at the girls to move, move, move and we all ran for the front door."
Another witness saw police approach the hotel while the alleged gunman was speaking with the waitress.
"As soon as the guy saw police approaching he pulled out a gun and that was when he pointed it ... and told us to go."
The $2 million Headlands restaurant is just off Highway 45 at the clifftop of Opunake's beach.
Its multi-level circular tower features a turret and houses a restaurant, cafe, commercial kitchen, and conference facilities on the ground floor, with three standard suites on the second floor and plush honeymoon suites on the third floor. A second block has four standard suites.