"A group of 30 men was planning to rob a bank branch" and opened fire on police when they approached after receiving a tip, said the Bahia state headquarters of the military police.
Three suspects and a police sergeant were also wounded in the ensuing shootout yesterday, police said.
Two of the wounded suspects are in hospital in serious condition. The rest of the group escaped.
Police said they seized high-caliber guns and drugs after the shootout.
An investigation has been opened into the incident.
Also Read
Brazil's police have come in for criticism for using excessive force in their bid to control violent crime in the country's impoverished neighbourhoods.
But Bahia public security secretary Mauricio Barbosa defended yesterday's operation.
"The police must act with severity, they must be tough. They can't do it arbitrarily, of course, but they must act firmly," he said at a press conference originally called to present plans for Salvador's world-famous carnival, which opens next week.
Rights activist Rafael Custodio disputed that view, saying Brazilian police have a "war mentality."
He called for sweeping reforms to stop the police from "treating Brazilian citizens as potential enemies."
In 2013, Brazilian police killed an average of six people per day, according to the most recent data available from the Brazilian Forum on Public Security, a watchdog group.
Between 2009 and 2013, the police killed more than 11,000 people, the same number killed by police in the United States in the past 30 years.
Bahia, one of the poorest states in Brazil, has been hit hard by spiralling violence in recent years.