Patricia Lourival Acioli had a reputation for giving harsh sentences to corrupt police and criminals [GALLO/GETTY]

An ambush by gun-toting attackers in Brazil has killed a judge known for taking a hard line against criminals, including corrupt police officers.

At least 16 bullets were fired by a group of attackers into the judge's car early on Friday morning as she arrived at her house in Niteroi, across a bay from Rio de Janeiro, according to Brazilian media reports.

Patricia Lourival Acioli, a 47-year-old mother of three, had been on a death list found in possession of a jailed militia leader this year, the Globo website quoted investigators as saying.

The slaying prompted the country’s supreme court to demand a swift investigation by the federal police.

"Cowardly crimes against magistrates are an attack on the independence of the judiciary, the state and Brazilian democracy," Cezar Peluso, the supreme court president, said.

"The preservation of the rule of law in our country demands a rapid investigation of the facts and a rigorous punishment of those responsible for this barbarous act."

Militias made up of off-duty police and firefighters have expanded in Rio's massive slums in recent years, driving out drug gangs in turf battles over the lucrative supply of services such as cable TV and cooking gas.

"Patricia received threats for at least five years. She was considered a hard-line judge, always giving the maximum penalty," her cousin, Humberto Nascimento, was quoted as saying by Globo.

He added that Acioli had sentenced several criminals involved in numerous wrongdoings.

"She sentenced people linked to the oil mafia, to the transports mafia. Militia in Sao Goncalo was growing at alarming levels; there were cops involved in misappropriation of public funds, corruption, drug trafficking," he said.

Source: Agencies