The 38-year-old asylum seeker was mortally wounded at around 2:00am (0000 GMT) Saturday after he tried to stab two other asylum seekers who were in the company of police officers in the southern Italian-speaking region of Ticino, police said.
Officers had been called in to break up a fight in Brissago, on the shores of Lake Maggiore, and were on the ground floor of a building when the Sri Lankan attacked the other people, police said in a statement.
In a bid to protect those present, an officer had fired at the assailant.
Despite attempts to administer first-aid, the man died on the spot. No one else was injured, police said.
An investigation has been opened into the shooting, they added.