Under the measure published Friday in the official gazette, "organizing, being part of or maintaining" a militia or other paramilitary organization is now punishable by four to eight years in prison.
Militias comprised of former or current police officers and firefighters took on drug trafficking gangs to wrest control of Brazil's slums and the lucrative black markets they spawned during the 1980s and '90s.
Militia members were often behind executions of street children, drug addicts and others they considered undesirable. They also demanded protection money from slum residents.
The groups were long tolerated for their stance against drug gangs, but are now widely considered as corrupt.
Militias currently control about half of the slums in Rio de Janeiro.