Heineken has acquired the Brazilian operation of Japanese brewer Kirin for €664m (£563.4m) as it battles to keep up with AB InBev in the wake of the AB InBev mega-merger with SAB Miller.

The deal for lossmaking Brasil Kirin Holding, which is worth €1bn (£869.6m) including debt, will make Heineken the second largest beer company in Brazil, behind rival AB InBev.

It boosts the Dutch brewer’s share of the Brazilian market from 10% to 19% and strengthens its presence in the north and north east of the country, where it currently has less exposure.

The transactions follows the £405m agreement for Heineken, in partnership with real estate investor Patron, to buy Punch Taverns in December.

Analysts at investment bank Liberum said Heineken was moving quickly to cement its position in key beer markets while peers were tied up following the AB InBev/SAB Miller deal.

Brasil Kirin increased revenues in 2016 to R$3.7bn (£951.9m), compared with R$3.7bn (£950m) in 2015, and operating losses shortened from R$322m (£82.7m) to R$262m (£67.3m).

The Japanese business paid £3.9bn in 2011 for 12 breweries in Brazil, but has since struggled with declining market share, cost rises and weak currency.

Heineken already operated five breweries in Brazil, the third largest market in the world for beer by volume, following the acquisition of Fomento Económico Mexicano in 2011.

The Dutch group said although conditions have been challenging over the past few years in Brazil, the longer term fundamentals of the Brazilian beer market were “highly attractive” and supported by a growing population and a positive GDP outlook.

Heineken CEO Jean-Francois van Boxmeer added: “This transaction marks a step-change in scale in an exciting beer market, building on our success to date in the premium segment and strengthening our platform for future growth.

“It reiterates our commitment to the Brazilian market and confidence in our ability to generate attractive returns over the long-term across all segments of the market.”

The deal is expected to complete in the first half of this year, subject to approval from competition authorities.

Liberum said the price paid by Heineken for the lossmaking business was lower than historic multiples in the sector.

“Heineken has a good track record of improving acquired businesses and we expect it to deliver meaningful synergies in Brazil,” analyst Alicia Forry added.

“Kirin has run the business inefficiently and it is currently loss-making. Heineken has plans to return it to profitability through production efficiencies, footprint optimisation and back office savings.

“While Heineken has focused on the premium end of the market, Kirin has a more mainstream portfolio that can help Heineken expand distribution of its premium brands to more outlets. And, there is scope to make the Kirin portfolio more premium.”

She predicted that Heineken still had plenty of firepower left, after the Kirin and Punch deal, for further acquisitions.