Police were contacted on late Saturday morning when a 65-year-old man was threatening people in a shopping centre in Partille, east of Gothenburg.
When police later went to the man's home to take him in for questioning, he went on the attack.
"We got there and he was standing on his apartment's balcony with a knife and a spear that he was using to threaten police as they approached," Peter Adlersson of the local police told the TT news agency.
Police found out that a woman and child were inside the house and had locked themselves in a room to protect themselves from the man.
"We tried to talk to him but it was no use," Adlersson added.
When police arrived at the man's front door, the woman and child left the apartment, but so did the 65-year-old who went on the attack against the police.
Officers then opened fire. It remains unclear where on the body the man was shot, but his injuries were severe enough to prove lethal, and he was pronounced dead in the early afternoon at the Sahlgrenska hospital.
The man's family has been notified of the man's death. Police are launching an investigation and questioning witnesses and those involved.