South Korean internet company Kakao has become the largest shareholder of SM Entertainment, winning a battle for control of one of the country’s most iconic music agencies. Kakao and its entertainment unit have increased their stake in SM to 39.9%, they said in a Tuesday regulatory filing. Previously, the firm had held 4.9% of SM. Kakao purchased the additional shares for about 1.25 trillion Korean won ($963 million) through a tender offer launched earlier this month. In securing a controlling stake, Kakao has seen off rival HYBE, South Korea’s top music agency and home to boy band sensation BTS, after a bruising takeover battle. In a separate Tuesday filing, HYBE said it had sold some of its SM shares to Kakao, reducing its stake to 8.8%. Kakao CEO Hong Eun-taek acknowledged the acquisition, telling shareholders Tuesday that the companies would work to combine the strengths of Kakao’s tech expertise and SM’s intellectual property and production skills “to expand our collective growth.” “After the swift and amicable completion of the acquisition, we will form the business cooperation plans between Kakao, Kakao Entertainment and SM Entertainment, and share them with our investors,” he added. Kakao raised eyebrows earlier this month by doubling down on its quest to take control of SM, seeking to get a bigger piece of the music label just days after a previous share sale agreement between the two parties was blocked by a South Korean court. SM was founded by Lee Soo-man, a legendary music producer who is widely referred to in South Korea as “the godfather of K-pop” for introducing the genre to a mass audience. The company is known for representing hit artists such as NCT 127, EXO, BoA and Girls’ Generation. Recently, however, it’s made headlines for a different reason: shareholder battles. Lee has tussled with his firm’s management on multiple fronts this year — including how much of the company should be sold to either Kakao or HYBE. He sold most of his shares to HYBE for 422.8 billion Korean won ($334.5 million) in February, giving the agency a 14.8% stake. HYBE had also tried to increase its stake in the company in recent weeks, with its own tender offer that failed to gain traction. After that, Kakao swooped in by offering SM shareholders 150,000 won ($115) per share, significantly more than HYBE’s previous offer of 120,000 won ($92) per share. HYBE then formally called off its takeover bid. SM’s management said it wanted to move forward with Kakao because the two parties were aligned on how the agency should operate. SM Entertainment’s stock rose 3.5% on Tuesday following the news, while Kakao’s shares were little changed.