The 52-year-old man, who was a member of the Swedish National Home Guard , had previously had a relationship with the woman.
Police were called to a neighbourhood of summer cottages in Höganäs , in western Skåne, at around 8.30pm on Friday, after gunfire was heard.
The shots had been fired through a cottage door, injuring the 45-year-old woman. Police began a major hunt for the woman’s former boyfriend, who was described as dangerous and was thought to still be carrying a loaded weapon.
After midnight it emerged that the man had returned to the woman’s cottage. A large area was cordoned off and during the night police had continuous telephone contact with the man in the hope that he would leave the cottage voluntarily.
However, just after 5am on Saturday the man shot himself dead.
It is unclear what kind of weapon the man was armed with, but last year the rules for the storage of Home Guard weapons were tightened after a 21-year-old man shot a young woman and then turned the gun on himself.
Soldiers are no longer given the keys to the ammunition stores. Instead, only officers have access.
The woman who was shot on Friday evening is not in a serious condition.
“Physically she’s feeling OK, but psychologically she’s obviously not too good,” said Mats Härle, Helsingborg police spokesman.