The 16-year-old called triple zero threatening "acts of violence" around 10pm on Saturday, about the same time he was spotted outside a Bunnings store in the southern Perth suburb of Willetton.
Responding officers deployed Tasers when the boy rushed at them but he continued to advance at police before a single gunshot brought him to the ground.
The boy had been part of a de-radicalisation support program treating extremism since 2022.
Asked whether the program had failed, WA Police Minister Paul Papalia said working with radicalised people was challenging.
"It is a tough gig to try and change people's beliefs once they've become obsessed and radicalised in this way," he told Seven's Sunrise program on Monday.
"These are people who haven't necessarily committed a crime and you can't lock people up for holding a belief ... That's part of democracy.
"The de-radicalisation effort was being thrown at him - every effort was being made - unfortunately, in this case, it didn't prevent him from doing what he did."
Imam Syed Wadood Janud says Perth's Muslim community is bracing for a backlash. (Supplied/AAP PHOTOS)
The Imam of Perth's largest mosque has condemned the attack "in the strongest terms".
"There is no place for violence in Islam," Nasir Mosque Iman Syed Wadood Janud said.
"This was so close to home - any one of us could have been at Bunnings," he said.
Imam Wadood Janud said the local Muslim community was worried about a possible backlash.
"We're extremely concerned about Islamophobia," he said.
"Sometimes the backlash can be very harsh."
The teen, who was known to police and had mental health and online radicalisation issues, was taken to hospital and declared dead about 11pm on Saturday.
About 10.15pm last night, Saturday May 4 2024, police responding to a 000 call encountered a male— WA Police Force (@WA_Police) armed with a knife in a carpark on High Road in Willetton. pic.twitter.com/hkYdIBW95EMay 5, 2024
An injured man in his 30s was found close by with a stab wound and transported to Royal Perth Hospital, where he remains in a serious but stable condition.
WA Police Commissioner Col Blanch said the teen had acted alone during the attack, which appeared to be random because he had no connection to the victim.
Members of the Muslim community became concerned about the teen after he posted messages online and contacted police before the incident.
Federal minister Tanya Plibsersek commended the actions of the community.
"I think that shows what good, strong community policing can do," she told Sunrise on Monday.