(Rewrites with details of share purchase; adds Murakami statement in paragraphs 9-10, Cosmo statement in paragraph 11)

TOKYO, Dec 1 (Reuters) - Japanese gas company Iwatani Corp said on Friday it would buy a stake of about 20% in Cosmo Energy Holdings from a group of activist investors, effectively serving as a white knight for the country's third-biggest oil refiner.

Iwatani will pay 105.3 billion yen ($710.8 million), or 6,052 yen per share, to raise its stake in Cosmo to 19.93% from the current 0.07%, and will buy an additional 0.29% subject to regulatory approval, according to an exchange disclosure.

The share acquisition marks an end to Cosmo's high-profile battle with a group led by prominent activist shareholder Yoshiaki Murakami, which had flagged its intention to raise its stake to nearly 25%.

The purchase price represents an 8% premium to Friday's 5,616 yen closing price, which an Iwatani spokesperson said factored in expected synergies from the partnership between the two firms.

Iwatani said the two already cooperate in hydrogen-related projects and other areas.

Cosmo had called for a shareholder vote on Dec. 14 to seek approval for a revised "poison pill" strategy to block additional share purchases by the Murakami-led group.

Cosmo Chief Executive Shigeru Yamada had told Reuters last month that the company could struggle to win shareholder support for a takeover defence, which certain investors flatly oppose.

But influential proxy adviser Institutional Shareholder Services this week recommended that shareholders vote for the poison pill.

In a statement issued after Iwatani's Friday announcement, Murakami-linked fund City Index Eleventh said it had dropped the plan to buy more Cosmo shares.

"We hope Iwatani's ownership would accelerate Cosmo's efforts to further increase shareholder value," it said.

Cosmo said in a separate statement that it had received a letter from the Murakami-linked group about its intentions and would consider how to proceed. ($1 = 148.1400 yen) (Reporting by Kantaro Komiya, Makiko Yamazaki and Yuka Obayashi; Editing by Miral Fahmy and Edmund Klamann)