LOOKING TO MAKE ITS FIRST EXPANSION OUTSIDE the U.S., Direct Edge, an upstart electronic stock exchange, decided in November to launch a bourse in Brazil to take advantage of the country’s fast-growing equity market. But rather than open in São Paulo, the Brazilian business capital that’s home to the incumbent BM&FBovespa stock exchange, Direct Edge will set up shop in Rio de Janeiro. The city’s booming asset management industry was a key factor in the decision, as was the fact that the Comissão de Valores Mobiliários, the Brazilian securities regulator, is based there, says Anthony Barchetto, head of strategy at the Jersey City, New Jersey–based firm.

“The city government is very keen to bring a proper exchange back to Rio,” Barchetto explains. “For us that is one of the key reasons we opted for Rio. That political support is very beneficial, in particular when we have to talk to officials of the CVM.”

Rio de Janeiro is known as the cidade maravilhosa — “the marvelous city.” Today more than ever, there is a great deal to marvel at.

Brazil’s second city, which has languished for decades in the shadow of its larger rival to the southwest, is enjoying an unprecedented economic boom. The local asset management industry is thriving, especially hedge fund managers who find that Rio’s financial heritage, natural beauty and easygoing lifestyle make an attractive environment for doing business. The discovery in the past decade of vast oil reserves some 250 kilometers (155 miles) off the Rio coast has attracted an influx of investment and talent from companies foreign and domestic, led by state-owned Petróleo Brasileiro (Petrobras), which has its headquarters in the city. And a massive investment in infrastructure ahead of the 2014 FIFA World Cup and the 2016 Summer Olympic Games is fueling economic activity and promising to overhaul Rio’s roads, ports and buildings for the 21st century.

“The World Cup and the Olympics are incredibly important,” says Marcelo Haddad, executive director of Rio Negócios, the city’s inward investment agency. “They will raise the city’s international profile greatly. Furthermore, they create fixed dates by which huge infrastructure projects must be completed. Those plans are transforming Rio and will make the lives of cariocas [as residents of Rio are known] a lot easier.”

The scale of the investment is staggering. For the two sporting extravaganzas, the government and the private sector are expected to spend some 23 billion reais ($13.4 billion) on stadiums, an Olympic village, an extension of the subway, a new rapid-transit bus network, hotels and other facilities. The city’s revival is also spurring a range of other investments, such as the multibillion-dollar Marvelous Port Project, a massive waterfront development likened to London’s Canary Wharf that is expected to create 50 million square feet of high-quality office, retail and residential space.

The oil boom is generating even bigger investment flows. Petrobras alone plans capital spending of $212 billion between 2010 and 2014 to develop the country’s offshore oil resources. “The oil and gas discoveries are absolutely huge and were great news for Rio,” says Haddad. “The capital expenditures involved are vast. It is on the scale of America’s Apollo program to put a man on the moon.”

Although only a fraction of that investment will be spent directly in Rio, the energy sector is drawing thousands of executives and engineers to the city and spurring a wide range of foreign companies — from Russia’s Gazprom to Dow Chemical Co. — to establish offices there. “Dow came to Rio because of the amazing opportunities the city offers,” says Lauro Rebouças, director for Dow Brazil, a subsidiary of the U.S. chemical company, who recently moved from São Paulo to open the company’s Rio office. “Developments in the oil and gas sector were the major attraction. It’s not just Petrobras — all the world’s most important oil companies, including Shell, Total and BP, have their Brazilian base here. It’s vital to have an office near theirs.”

Rio’s revival is about more than just investment flows, as important as those are. The authorities have been moving aggressively in recent years to repair the city’s stretched social fabric. They have sent teams of police and army troops into the notorious favelas, or hillside slums, to root out drug gangs that terrorized local residents, and extended utility services and transport links to knit those hillside neighborhoods into the city’s economy (see story, above).

These forces have combined to give Rio a newfound energy and dynamism: a hint of Houston from the oil money, echoes of New York’s financial sector without its gloom, a touch of London’s cosmopolitan nature, all leavened with the distinctive joie de vivre of the cariocas.

With a population of 6.3 million — 12.3 million in the greater metropolitan area — Rio is the second-largest city in Brazil and the fourth largest in Latin America after Mexico City, São Paulo and Buenos Aires. It has long had enviable economic strengths. Rio’s per capita gross domestic product stood at 25,122 reais in 2008, 57 percent above the national average, according to the Brazilian Institute of Geography and Statistics. Some 56 percent of Brazil’s economic output is produced within a 500-kilometer radius of the city; Rio receives a quarter of all foreign direct investment in Brazil, which totaled $48.46 billion in 2010, according to the United Nations’ Economic Commission for Latin America and the Caribbean.

Six of the country’s 13 largest companies have their headquarters in Rio, including Petrobras, mining giant Vale, mobile telecommunications operator TIM Brasil and EBX, the holding company of Eike Batista, Brazil’s richest man. BNDES, the state-owned entity that is the world’s largest development bank, with some 625 billion reais ($366 billion) in loans outstanding, is based in the heart of the city center, just across the street from Petrobras. Rio is also home to Globo Organizations, the largest media conglomerate in Latin America, and it boasts nearly a dozen leading universities, including the Getulio Vargas Foundation, which operates Brazil’s top management school.

The city’s revival won fresh validation in December when Moody’s Investors Service raised its rating on Rio to Aaa.br, the highest level on its local scale. Moody’s cited the city’s strong finances — the budget had a gross operating surplus of 17.4 percent of revenue in 2010 — a healthy tax base and reliable transfers from the state and federal governments. Rio is the only Brazilian city to have an investment-grade rating from the U.S. agency.