Caterpillar Inc agreed to buy a U.S. maker of railroad locomotives for $820 million in cash, expanding its rail business from service into new engine manufacturing.

The world's largest maker of heavy equipment said it was buying Electro-Motive Diesel, which last year generated $1.8 billion in revenue, from private equity firms Berkshire Partners LLC and Greenbriar Equity Group LLC.

The new business will be a part of Caterpillar's Progress Rail operation, which will now compete more directly with General Electric Co, another major U.S. maker of locomotives.

The deal is expected to close by the year's end.

Demand for railroad locomotives has been weak of late, as the recession lowered demand for transportation of all sorts of bulk commodities.

However, U.S. railroads including No. 1 Union Pacific in recent months have begun to report rebounding profits as volumes begin to grow after a two-year slump. Union Pacific last month said it aimed to boost its capital spending budget this year to $2.6 billion, planning to spend that on intermodal equipment, which enables trains to carry equipment that can also travel by ship and truck. (Reuters)