Police received reports of a stabbing rampage near a shopping center in the town of South Hedland on Friday morning.
The suspect, in his early 30s, was armed with a large knife, He is believed to have first attacked a man sitting in a vehicle, before entering the mall.
He then slashed a further six people inside the premises, as well as two police officers.
One of the victims was a young woman, who was stabbed while pushing an infant in a stroller.
The attacker was confronted by two officers and ordered to drop the knife multiple times, before one fired several shots and killed him, Western Australia Police Force Commissioner Chris Dawson said.
Dawson said one of his officers “narrowly escaped serious injury” in what police described as a “confronting and dangerous” rampage.
“It was a very dangerous [situation]. And the actions and decisiveness of these two officers, I believe, has resulted in no other persons being further injured,” Dawson said.
David J Derschow told CNN that his girlfriend Esther Brooks was hurt in the attack.
“I started hearing screaming coming from the entrance where she [was supposed] to come out from and I went to see if she was [safe] but people and kids where running out,” he said.
“I saw my partner walk out. I asked what happened and she just asked if she had been stabbed and sure enough she was.”
Brooks was taken to hospital and later discharged after receiving stitches. She has since given a statement to the police.
Police said the attack was not believed to be politically or ideologically motivated.