About 500 people, some armed with machetes, wanted the police to release the four kidnapping suspects so they could deal with them.
Officers outside the police station in Ikongo refused and fired tear gas to disperse the crowd on Monday. When the mob kept advancing on the station, police opened fire.
Assaults against those with albinism are often motivated by a witchcraft-based belief that their body parts bring good luck.
“The gendarmes tried everything to avoid a confrontation or violence. They set up a security perimeter around the gendarmerie barracks and they told the crowd that we could talk to prevent bloodshed," Gen. Andry Rakotondrazaka, commander of the national gendarmerie, said.
He said many of those in the crowd carried large machetes or other weapons with blades and sticks. When they threw stones at the police, the police opened fire, Rakotondrazaka said.
He said the killings are being investigated.
In a post on Facebook, President Andry Rajoelina said he was sad to hear the news. He appealed for calm and confirmed the incident would be investigated.
More than a dozen kidnappings, assaults and murders of people with albinism have been reported in the past two years in various parts of Madagascar, according to figures published by UNICEF in March 2022.
About 40 per cent of people in Madagascar approve of mob justice, according to a survey in 2019 by the Afrobarometer organization.