Amokrane Sabet, reported to be a mixed martial arts fighter, was known as a troublemaker in the area in southern Bali where he lived.
Picket police: Three killed in police encounter
"There had been many complaints about him such as eating at restaurants without paying, carrying a knife, and harassing people, but every time we called him in for questioning, he never showed up," Bali police spokesman Hery Wiyanto told AFP.
Around 40 police and immigration officials came to arrest the 49-year-old after discovering that his tourist visa had run out in September.
But as they arrived at his residence in Canggu, a village popular with foreign tourists, Sabet emerged brandishing a knife.
"One of our officers tried to approach him and calm him down, but Sabet stabbed him," said Wiyanto, adding that the officer died from his wounds.
‘Fake police encounter’: Murder case registered against SHO, three others
Police then gave Sabet three warnings but as these were ignored, they shot him several times, Wiyanto said. Images circulating online showed Sabet waving a knife and later lying on the ground.
The French embassy in Jakarta said it had been informed of the death and was in contact with police.
Such flare-ups of violence are rare in Bali, a pocket of Hinduism in Muslim-majority Indonesia that attracts millions of foreign tourists to its palm-fringed beaches every year.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ