The lower house of the Brazilian Congress has narrowly rejected a proposed amendment to the constitution that sought to lower the age of criminal responsibility.
If the amendment had been passed, children between 16 and 18 years of age could have been tried as adults.
They could have faced the same sentences as adults, and been sent to adult jails, for serious crimes.
The bill’s supporters argued that it would have acted as a deterrent.
They said that under the current system, teenagers who have committed serious crimes often only serve short sentences.
Opponents however said the bill would have had “disastrous consequences”, with young people put at risk in Brazil’s overcrowded and dangerous adult prisons.
Justice Minister Eduardo Cardozo called the proposal an “atomic bomb” for the prison system.
He also said that some Brazilian jails were “veritable crime schools” where young people would be negatively influenced by hardened criminals.
A majority of members of the lower house voted in favour of the move, but they were five short of the number of votes needed to pass the bill.
The bill had been amended to restrict the age reduction to only the most serious crimes, such as murder and rape.
The original bill, which seeks to lower the age at which youngsters can be prosecuted as adults for all crimes, still has to be voted on.
However, some of the lawmakers who supported trying 16- to 18-year-olds as adults for the most serious crimes said they would not do so for all crimes.
The original bill therefore looks unlikely to gain more votes than the amended version.