(Reuters) - A consortium led by Hong Kong's CK Infrastructure (>> CK Infrastructure Holdings Ltd) said on Thursday it would buy German metering and energy management group Ista in a deal valued at up to 4.5 billion euros (4.01 billion pounds).

The deal could be Germany's second largest by a private equity firm if buyout groups Bain Capital and CinvenStada succeed in buying generic drugmaker Stada.

CKI - part of conglomerate CK Hutchison (>> CK Hutchison Holdings Ltd), controlled by Hong Kong's richest man Li Ka-shing - is acquiring Ista from private equity fund CVC.

CK Infrastructure, Cheung Kong Property Holdings (>> Cheung Kong Property Holdings Ltd) and Midco 5 have formed a joint venture to acquire the company, the firms said in statement filed with the Hong Kong exchange.

CVC confirmed the sale of its majority stake in Ista in a separate statement.

The deal is being closely watched by investors ahead of the planned sale of Ista's peer Techem by Australian infrastructure investor Macquarie in the autumn, sources have said.

Ista, which provides energy and water metering, posted earnings before interest, taxes, depreciation and amortisation (EBITDA) of 370 million euros in 2016 on sales of 850 million euros.

Buyout group CVC, which bought Ista in 2013 at a valuation of 3.1 billion euros, had hoped the company to be valued at 5 billion euros, people familiar with the matter said last month.

Reuters reported on Tuesday that CK Infrastructure was seen as the frontrunner to buy the German firm.

CKI has a market capitalisation of HK$190 billion ($24 billion) and is invested in electricity generation and distribution, gas distribution, oil pipelines, water supply and wind power.

(Reporting by Anusha Ravindranath in Bengaluru; Editing by Sriraj Kalluvila and Anil D'Silva)