In the past month, the Brazilian mining group Vale, the world's biggest producer of iron ore, has been stalking its Anglo-Swiss rival Xstrata. Vale raised eyebrows in the industry when it bought the Canadian nickel miner Inco last year for $18bn, but a deal with Xstrata, likely to be worth around $90bn, would put that acquisition in the shade.

The audacious bid is emblematic of a new swagger among Brazilian corporations. Confidence has been fuelled by a period of economic stability, the commodities boom, a growing domestic middle class, the opening up of the debt markets and a booming stock market - the Bovespa, which has been delivering some of the best returns of any market worldwide over the past few years. Since 2002, the Bovespa has risen by 1,250 percentage points.

Until recently Brazil was seen as the laggard of the emerging Bric (Brazil, Russia, India and China) economies, but as economic and political conditions have improved, investment has been pouring in. Growth, while not matching China's, is expected to have been 5% last year.

President Lula "has been a pleasant surprise," says Vale president Roger Agnelli. Sergio Antonio Garcia Amoroso, of the paper company Orsa, agrees. "Investors are feeling secure, so much so that foreign investment has increased substantially".

Brazil was the world's fifth biggest market for initial public offerings last year, and accounted for some 85% of equity being issued in Latin America. The boom was driven initially by natural resources companies, but the past year has seen other firms joining the market, from retailers to biofuels, many riding the growth of the domestic Brazilian consumer as well as export market.

"The Brazilian market has outperformed the US stock market in the year to date," says Katy Dobson, Latin America fund manager at the asset management firm Threadneedle. Brazil is booming."

There were 64 IPOs on the Bovespa during 2007, between them raising $42.8bn. Much of the investment is coming from outside Brazil. During 2007, there was a net inflow of foreign investment on the exchange of $23.5bn. The value of daily trades on the exchange more than doubled, from an average of $1.2bn in 2006 to an average of $2.6bn in 2007. The total market capitalisation of the companies on the exchange rose from $723bn at the end of 2006 to $1.4 trillion at the end of 2007. The market rose around 75% during the year.

The biggest IPO of the year was Bovespa itself, which raised $3.7bn, the fifth largest IPO in the world last year, according to Thomson Financial. Some 80% of the investor interest came from overseas, including NYSE Euronext, owner of the New York Stock Exchange, which paid $90m for a 1% stake. On its first day trading, shares in Bovespa rose 52%.

At around the same time, the Chicago Mercantile Exchange agreed to take a 10% stake in Brazil's Mercantile & Futures Exchange, Latin America's largest derivatives market, for $742m. In November it raised $3.4bn in an IPO.

There has also been a growing amount of M&A activity within Brazil, eased by the fact that once family-owned companies are increasingly dominated by outside investors. The exigencies of the capital markets have also forced many companies to drastically improve corporate governance, transparency and productivity. Private equity has also been taking an increasing interest in Brazil, partly because of the health of the IPO market, which has provided a steady option for exit.

There have been some concerns that a bubble might be building in Brazil. Questions have been asked about the quality of some of the companies on Bovespa. And analysts also point out that the key index on the Bovespa remains heavily weighted toward just two companies; Vale and the oil giant Petrobras, which together account for roughly 30% of daily trades. According to the Financial Times, the Bovespa still ranks 21st in the value of trades, despite its rapid growth, way behind New York, Nasdaq and London.

More broadly, critics also point to the unwieldy public sector, heavy tax burdens, onerous labour laws and relatively poor infrastructure. There is little appetite for further economic reform. The currency, the real, has also been strengthening, which some industry bosses and exporters fear will erode Brazil's competitiveness. The biggest threat would come from a collapse in commodity prices.

Still, the markets look to be ready for the next step. The three leading rating agencies all have Brazil just one notch below the all-important investment grade, something it is expected to win later this year. If it does, it would open Brazilian assets to large institutional investors, including the big European and American pension funds, and a new chapter would begin.