The ongoing global trade war spat with China and challenges faced by competitors in the local market are not stopping Heineken from getting serious about China's beer market.

On Friday Heineken NV (HEINY) announced a $3.1 billion deal with China Resources Enterprise and China Resources Beer, acquiring a 40% stake in the parent company of China Resources Beer, the country's largest brewer. The move signals Heineken's Asia expansion and long-term ambition for the world's biggest beer market. China's beer market topped world sales with $83.3 billion last year, according to Euromonitor.

Under the terms of the deal, Heineken's Chinese operations will be folded into China Resources Beer's domestic operation in exchange for $2.4 billion in CRB's stock. China Resources Enterprise will receive 5.2 million Heineken shares as a result of the transaction.

"China's beer market is now the second largest premium beer market globally and is forecast to be the biggest contributor to premium volume growth in the next five years, driven by its rapidly growing middle class," Heineken said in a statement. "Profitability of the Chinese beer market is expected to improve significantly, driven by premiumization, demand for international beer brands and cost optimization."

Heineken's American Depositary Shares rose 1.0% to $52.00 in Friday trading on the over the counter market in the U.S.

The deal gives Heineken an opportunity to catch up with its competitor Anheuser-Busch InBev (BUD) - Get Report , which is the largest foreign player in China's $70 billion beer market.

Heineken is responsible for less than 1% of total volumes in China in 2017 compared to Anheuser-Busch's 16%, Euromonitor data shows.

Heineken will be China Resources Beers' exclusive partner for the importation of foreign premium beers to China.

Goldman Sachs analyst Mitch Collett wrote Friday that the deal was "broadly positive" for Heineken, giving it a bigger manufacturing and distribution footprint in China through CRB.

"Given Heineken has struggled to grow the Heineken brand in China, we believe this is likely to accelerate the brand's growth going forward," Collett said in a note on Friday.

Jefferies analyst Edward Mundy wrote the tie-up is "an elegant solution," to Heineken's problems ramping up penetration of Asia and, "a foot in the door to gain control of CR Beer," should the Chinese government wish to sell.

As it stands, the scale of Heineken's acquisition sets it up to grab market share from the Carlsberg brand rather than Anheuser-Busch InBev, which is more established.

"We see less risk to ABI given their scale and deep pockets," Mundy wrote. "While Carlsberg has a stronger business than historically, its potentially more at risk from the Heineken transaction given its smaller local and global scale."

The deal comes at a time when many established beer brands face declining sales in mature markets and are turning to faster-growing markets or looking to experiment with new product categories like cannabis.

According to a new study the Beer Institute, a trade group, drinkers chose beer just 49.7% of the time in 2017, down from 60.8% in the 1990s. Per capita beer U.S. beer consumption fell to 73.4 liters last year, from 80.2 liters in 2010 and 83.2 liters in 2000, according to IWSR, a drinks market research firm.

Image placeholder title

More Coverage of Heineken N.V., Today's Stock of the Day, on Our Premium Site Real Money

Heineken: Those Green Bottles Are Showing Green Signals