Brazil is one of the most violent countries in the world, with nearly 60,000 homicides annually.
Brazilian President Michel Temer has announced the creation of a public security ministry after giving the military full control over security in crime-plagued Rio de Janeiro.
Temer came to the city to meet Governor Luiz Fernando Pezao, several ministers and General Walter Souza Braga Netto, who will lead the operation and who was in charge of coordinating security when the city hosted the 2016 Olympic Games.
"From next week or the next, I want to create a Ministry of Public Security to coordinate all efforts," said Temer Saturday after leaving the meeting.
The new ministry would have a similar portfolio to the interior ministry.
Army patrols were already used in Rio's gang-ruled favelas, but a decree signed on Friday by Temer now gives the military overall control of security operations in Rio state, which the president said had been virtually seized by organized crime gangs.
Brazilian police are normally under state supervision.
Temer's order for "federal intervention" places command in Netto, who will report directly to the president and not to authorities in Rio, the country's most populous state with around 16 million inhabitants -- 6.5 million of them living in Rio de Janeiro.
The decree is already in force but must still be validated by Congress, which has scheduled a vote for Monday evening.
The army's mission will last until the end of Temer's term as president on December 31.
Temer said he was taking "extreme measures" in the face of organized crime which has spread throughout the country "and threatens the tranquility of our people."
Officials cited, in particular, violence during this month's carnival but David Fleischer, a professor of political science at the University of Brasilia, said other factors also came into play.
He said Temer is desperately "trying to distract" attention from corruption allegations that have embroiled his presidency, as well as his struggles to adopt pension reform.
Arthur Trindade, a university professor and former security secretary for Brasilia, said the main objective of the decree is to "clean up" a police force undermined by corruption.
Eight months before a presidential election, the leftist opposition is wary of military intervention in a country still marked by two decades of military dictatorship which ended in 1985.
"The situation in Rio is serious but it is necessary to be vigilant that these measures are not accompanied by the repression of social movements and the suspension of constitutional rights," said Gleisi Hoffman, president of the Workers' Party of former president Luiz Inacio Lula da Silva.
Polls place Lula in the lead for October's presidential ballot even as he fights to avoid prison for corruption.
More than 8,000 troops were sent to Rio de Janeiro in July to help the overstretched police but results were insignificant.
Rio state has been badly hit by Brazil's recession and a slump in the oil market, as well as by massive corruption.