HONG KONG (Reuters) - China's CITIC Pacific (>> CITIC Pacific) has agreed to buy the main operating unit of its parent, state-backed CITIC Group, for $36.5 billion (21.7 billion pounds) in a stock and cash deal aimed at diversifying its metals and mining business.

The purchase will give a much-needed boost to CITIC Pacific's ailing finances after it miscalculated the huge cost of developing a mine in Western Australia.

The deal is the biggest injection by any Chinese firm into a Hong Kong listed company, analysts said, and shares in CITIC Pacific have gained nearly 13 percent since the company and its parent unveiled initial details of the purchase in late March.

"The enhanced financing capability should enable CITIC Pacific to continue the funding of existing capital intensive projects such as the Sino Iron project in Western Australia," CITIC Pacific said in a filing to the Hong Kong stock exchange.

CITIC Pacific will pay 49.92 billion yuan (4 billion pounds) in cash and issue 177.01 billion yuan worth of shares to CITIC Group. It will also sell another 4.66 billion shares to institutional investors to comply with the exchange's requirement to maintain a minimum 25 percent free float.

The deal needs to be approved at a shareholders' meeting on June 3, and is expected to be completed by August 29, CITIC Pacific said. As part of the deal, the company is proposing to change its name to CITIC Ltd.

Under the deal, CITIC Pacific will acquire CITIC Ltd, which has businesses in China ranging from real estate to banking, securities, infrastructure, energy, natural resources and engineering. It made a net profit of 34.3 billion yuan in 2013.

CITIC Group, China's oldest and biggest financial conglomerate, was established in 1979 by Rong Yiren, one of the few industrialists to stay behind in the mainland after the 1949 revolution. The company was set up with the support of former leader Deng Xiaoping, and now has 11 stock market-listed entities.

After the transfer, CITIC Pacific will own stakes in the these listed companies, including CITIC Securities <6030.HK> (>> CITIC Securities Company Limited), CITIC Guoan Information (>> CITIC Guoan Information Indust. Co., Ltd), and heavy machinery maker CITIC Heavy <601608.SS>. It also has a stake in China CITIC Bank <0998.HK> (>> China CITIC Bank Corporation Limited), which has a market value of $31.8 billion.

(Additional reporting by Stephen Aldred; Editing by Miral Fahmy)

By Elzio Barreto and Denny Thomas