A gunman fired a total of 34 shots before he was fatally shot in the head by a police officer, an inquest has heard.
Alistair Bell, 42, had previously wounded an unarmed policeman who had gone to arrest him at his house in Kirkheaton.
Firearms officers were then deployed to his address as Mr Bell continued to fire shots out of windows before being gunned down by an officer as he came down the stairs of the property in the early hours of the next day on December 28, 2010. He was taken to hospital and was pronounced dead shortly after arrival.
Outlining the case to a jury at Bradford Crown Court, West Yorkshire Coroner Neil Cameron told them: "You will have to determine in what circumstances arising out of that incident the deceased came by his death."
He said police went to Mr Bell's home on the evening of December 27 after a complaint made to them by a man who had a "long-running dispute" with him.
Three unarmed officers went to the front door of the property, the court heard.
Mr Cameron said: "Mr Bell was in the house. He opened the door briefly and then shut it again.
"One of the officers opened it and stepped in the house. He saw Alistair Bell inside holding a pistol and pointing at him.
"The officer shouted a warning to his colleagues and the officers ran to take cover.
"Alistair Bell fired a number of shots. One officer (a police constable) was wounded."
Armed officers were then sent and surrounded the house, the coroner continued.
During the night Mr Bell fired a number of shots out of the window and he also made a number of phone calls and sent text messages to family members and friends, as well as a police negotiator.
The inquest heard Mr Bell eventually came downstairs and was shot by an officer who fired three rounds from a carbine.
One hit him in the crown of the head, which penetrated his brain, and another struck him to the left lower chest.
"The precise circumstances in which they were fired, what the officers saw and what Alistair Bell was doing, we shall hear about when the officers give evidence," Mr Cameron said.
He added: "Alistair Bell appeared to have fired a total of 34 shots from a pistol which meant he must have reloaded at least four times.
"Many of those appear to have been fired out of windows through curtains and blinds, or from positions where it was not possible to identify any specific targets."
The only shots fired by the police were the three from the one officer, the jury was told.
Mr Bell was not licensed to own the pistol or a second unused firearm which was later recovered from the house.
The inquest heard a "significant" amount of anabolic steroids was found in Mr Bell's system on toxicological examination - with a small number of the population susceptible to "irrational" or "aggressive" behaviour from heavy use.
Mr Cameron told jurors he had previously ruled that 11 police officers involved in the incident would not be named during the inquest and had received anonymity in the proceedings.
A number of them, including the officer who shot Mr Bell, would give evidence screened from the public gallery and the press.
The inquest is expected to last up to four weeks and continues tomorrow.