A teenager shot dead by police as he held a pistol to a hostage's head fired the weapon twice during another robbery 25 hours earlier, an inquest has been told.
Detective Inspector Chris Olen said investigations revealed that on the night before David Taufahema died during a failed pub hold-up, he tried to rob a Chinese restaurant.
A juvenile accomplice told police Taufahema "would try to shoot anyone who tried to stop him".
An inquest into the 18-year-old's death began at Parramatta Court on Monday.
Counsel assisting the coroner Peter Aitken said Taufahema was shot once by Senior Constable Ross Simon in the early hours of September 1, 2009, at a Canley Vale hotel in Sydney's west.
Taufahema and the juvenile had their faces disguised and were carrying weapons when they entered the hotel, where 18 patrons were inside.
While the juvenile ordered customers to lie down and hand over their valuables, Taufahema ordered the manager to open the safe, the tills and poker machines, Mr Aitken said.
A diner who saw people lying on the ground fled to the disabled toilet and rang triple-zero.
While inside, she heard sirens, a helicopter and a voice saying "shit, cops, cops" before she heard a different voice saying "put the weapon down; get down, get down".
Mr Aitken said Taufahema grabbed the manager, pointed the gun at him and moved to the front door, where he was confronted by two police officers.
He expected the manager would testify that the officers had their guns drawn and told Taufahema to put his weapon down, but Taufahema said: "I'm going to shoot him."
The juvenile was behind them with what appeared to be a rifle raised.
Mr Aitken said each officer fired, possibly a second apart, with one shot hitting the hotel wall.
The officer who fired that shot had believed the rifle was pointed at him.
Senior Constable Simon reported his colleague as yelling: "He is pointing at me."
He told police he pointed his weapon at Taufahema's head, as the hostage "was in front of the remainder of the deceased's person".
Fearing they were about to be shot, he fired his gun once, Mr Aitken said.
Detective Olen said that 25 hours earlier, the teenagers tried to hold up a restaurant.
"Mr Taufahema came into the restaurant armed and when a patron got up to run ... Mr Taufahema yelled out: `Don't run or I'll shoot you'," he said.
Taufahema discharged the pistol into the ceiling and outside fired another shot towards a driver, who had to swerve, he said.
The detective told the inquest the investigation revealed that none of the officers had known the identities of either of the two robbers.
Taufahema's two older brothers, John and Motekiai Taufahema, were refused parole on Monday after spending seven years behind bars for their involvement in the killing of a police officer.
Senior Constable Glenn McEnallay was shot four times in the chest and head after pursuing a stolen car at Hillsdale in Sydney's southeast in March 2002.
The inquest is continuing.