Brazil's iconic state of Rio de Janeiro is getting a big bailout, just seven weeks before the Olympic Games arrive.

Brazil's federal government approved the bailout, worth about $850 million (2.9 billion reals), to beef up security in Rio for the Olympics Games. The cash will also be used to pay police officers, who have not been paid for overtime work for over six months.

It comes as Brazil struggles to show the world that it's ready to host the Olympics. Crime continues to rise in the city of Rio de Janiero.

Last weekend, a shootout took place at a hospital to free a local drug kingpin, known as "Fat Family." The hospital is designated to treat tourists during the Olympics. Separately, an Australian paralympian was robbed at gunpoint in broad daylight Sunday morning.

The lack of funds or preparation is showing up in other places. The state of Rio de Janeiro is charged with finishing a rail extension that will connect the Olympic facilities with the city center. That's not ready yet. Officials have said it will be completed...but they are targeting to finish it just four days before the Olympics begin.

None of the bailout cash has been carved out for the rail extension, even though Rio lawmakers asked for extra cash to complete it. Congress still needs to approve the bailout, even though it's not expected to meet any resistance.

The bailout announcement came three days after Rio's governor declared a state of emergency, citing the recession.

Related: Hospital attack sparks new security concerns in Rio

All of this bad news comes against the backdrop of a country badly bruised by political upheaval, economic crisis and the Zika virus.

Brazil's elected President Dilma Rousseff was forced to step down in May after Congress voted to start an impeachment trial against her for allegedly manipulating Brazil's budget to make it look better than it was during her re-election. In May, Rousseff had to step aside from the presidency for six months and won't be attending the Olympic Games.

Her successor, interim president Michel Temer, has had a rough start to his presidency. In just two months, three of his cabinet members, including the tourism minister, have resigned amid allegations of their alleged involvement in the massive corruption scandal at Brazil's state-run oil company, Petrobras. Critics are also calling for Temer's impeachment.

Related: Brazil spirals deeper into recession

Amid all of this, Brazil's economy is in tatters. The country is in the midst of its longest recession since the 1930s. It shrank 3.8% last year and its central bank forecasts a 3.5% contraction this year. Brazilians are in no mood to spend during such tough times -- a key reason why ticket sales are down for the Rio Games.

The state of Rio de Janeiro relies heavily on oil. The steep fall in oil prices have left Rio, along with other states, essentially broke. But it's not just oil prices hurting Rio. The corruption crisis has sidelined the state and city too.

Other states in Brazil are also seeking some sort of bailout but it's unclear if they'll receive the terms Rio is getting. Officials agreed it would be best to help aid Rio first since its hosting the Summer Games. They also are allowing all Brazilian states to defer debt payments to the federal government until next year and at reduced rates.

Related: Jaguar shot dead in Brazil at Olympic torch event

Brazil was also ground zero for the Zika virus, which continues to be a top concern for travelers and athletes going to Rio. Some athletes have decided not to go to Rio for fears of getting Zika, a virus that's been linked to microcephaly, a condition that causes babies to born with abnormally small heads.

It's important to note that the Rio Games will be held during Brazil's winter and the number of Zika cases have plummeted as the weather cools in Rio. In late February, there were about 16,000 Zika cases reported in one week. By the beginning of May, there were only 2,000 Zika cases in a week, according to Brazilian officials.

Even though Zika cases are dwindling, fears of the virus aren't. They're one of the many things tainting the lead up to Rio Summer Olympics.

--Flora Charner, Marilia Brocchetto and Nick Paton Walsh contributed reporting to this article.