By Silvio Cascione and Brad Haynes

BRASILIA/SAO PAULO (Reuters) - A rebound in spending on machinery and equipment by Brazilian companies should lead Latin America's largest economy out of a deep recession in the coming months, providing a much-needed boost for new center-right President Michel Temer.

A recent survey of chief financial officers by the local American Chamber of Commerce showed nearly half of the companies had put investment and strategic decisions on hold during the impeachment of leftist President Dilma Rousseff.

The Senate's dismissal of Rousseff on Wednesday on charges of breaking budget rules could unleash a wave of new investments under her successor Temer, her former vice president who has served as interim president since she was suspended in mid-May.

Temer has pushed a pro-business agenda, courting investors with plans to stabilize government debt, sell public assets and offer a more predictable business environment, in a bid to pull Brazil out of what is likely to be its worst recession.

The prospect that Temer could serve the remainder of Rousseff's presidential term through 2018 has helped in recent months to spur new investments, including by French auto maker Renault <RENA.PA> and Chinese solar cell maker BYD Energy.

Economic data published on Wednesday showed that total investment in the second quarter grew for the first time since mid-2013. <BRGDP=ECI>

Further evidence of a recovery would strengthen Temer's hand in Congress as he tries to pass unpopular budget and pension reforms, the results of which will be far more important for investors than any brief post-impeachment honeymoon.

For the first time in years, economists have been raising rather than cutting their growth forecasts.

Imports of capital goods rose 16 percent in the second quarter, according to data from the Trade Ministry. Local production of capital goods has also grown every month this year as companies dust off their investment plans.

Although the recession left significant idle capacity, several manufacturers have shown eagerness to renovate their facilities for fear of missing the start of the recovery.

"There are relevant, unambiguous signs, that the worst moments for investments are behind us already," said Rodolfo Margato, an economist with Santander Brasil. "Investments will offer a significant contribution for the economy to grow 2 percent next year."

The market consensus is for Brazil's economy to grow 1.2 percent in 2017, according to a weekly central bank poll. That is well above the market's meager 0.3 percent consensus forecast four months ago.

Brazil's economy, however, has underperformed economists' forecasts since 2010.

ROSY OUTLOOK SHATTERED

One of the darlings of the emerging markets, Brazil enjoyed an investment boom that began in the 1990s as companies calculated that the country of 200 million people would emerge as a major economic power.

That rosy outlook was shattered by the recent recession, which began in 2014, as business confidence imploded and investment dried up. Unemployment soared - it was 11.6 percent for the three months through July - as did the number of companies filing for bankruptcy protection.

A budget crisis, caused by unexpectedly fast declines in tax revenues and the government's failure to quickly curb spending, further soured investors on the country's prospects. Brazil lost its investment-grade credit rating in 2015.

But green shoots have begun to appear in recent months, with a steady stream of companies announcing new capacity and upgrading of assembly lines. U.S. agrochemical maker Albaugh LLC, pulp maker Veracel Celulose SA and Chinese solar cell maker BYD Energy were among those to announce new investments.

"The expectations for the Brazilian economy are still cloudy, but it seems that we are experiencing a turning point," Harry Schmelzer Jr, the chief executive of electrical equipment maker WEG SA <WEGE3.SA>, said last month.

The optimism, however, has been spread unevenly.

Companies dependent on consumer spending, such as apparel retailers, are among those that may have to wait longer for relief, as stubbornly high inflation, crippling unemployment and decade-high interest rates weigh on household spending.

Economists are betting that investment will expand more broadly as the central bank puts a lid on price increases and starts cutting rates.

BAD INVESTMENTS

Investment has plunged about 27 percent since mid-2103, and few observers expect that drop to be entirely reversed in a rebound. Most economists forecast investment growth of between 3 percent and 6 percent in 2017.

"Some of these are natural investments to make up for capital depreciation and keep some competitiveness," said Thiago Curado, an economist with consultancy 4E in Sao Paulo. "A relevant part of the last investment cycle was poorly allocated, so capital depreciation has been higher."

Curado suggested companies will have to make new investments if they want to adapt to the new reality.

Even in devastated parts of Brazil's economy, such as the auto industry, where sales have fallen by half from their 2012 peak, companies are betting on new models and more efficient technologies to get an edge over rivals.

Brazilian-born Carlos Ghosn, chief executive of Renault <RENA.PA>, announced this month that the French carmaker was investing in two new models for Brazil.

"Right now we see Brazil's auto market recovery with great hope. I don't think anybody believes the Brazilian market will stay at around 2 million vehicles," he said, predicting the country's annual auto sales had the potential to double again.

(Reporting by Silvio Cascione and Brad Haynes; Editing by Paul Simao)