"The preliminary information we have for now is that more than 20 criminals have died," said the source with the Federal Highway Police.
No members of the security forces were among the dead, the source said.
The operation, carried out in conjunction with the Military Police, took place near the city of Varginha.
Police raided two farms where "members of a criminal organization specialising in robbing banks and ATMs" were preparing attacks on several local bank branches, the source said.
Eighteen suspected gang members died at one farm and two others were killed as police approached the second farm, he said.
A large trove of weapons was seized, including rifles and grenades, as well as several stolen vehicles, according to the source.
Police say such gangs often set fire to stolen vehicles to block streets after a robbery and make it harder for police to pursue them.
Brazil has seen an increase in highly planned bank robberies involving heavy weapons, usually in medium-sized cities where escape routes are carefully planned.
In August, a gang in the city of Aracatuba, in Sao Paulo state, spread terror during a robbery involving drones, explosives and the use of hostages as human shields.
Three people died.