The second largest merger in the history of beer has finally garnered government approval, as most thought it eventually would. Anheuser-Busch InBev (BUD) said Friday that it, Grupo Modelo, Constellation Brands, Inc. (STZ) and Crown Imports, LLC have reached a final agreement with the U.S. Department of Justice on Anheuser-Busch InBev’s acquisition of the remaining portion of Mexican brewer Grupo Modelo that it doesn’t already own.

Last year, Anheuser-Busch InBev offered $20.1 billion to buy the remaining shares of Grupo Modelo. On January 31, the Justice Department filed a suit to stop the acquisition on antitrust objections that the deal would give A-B inBev too much control over the American beer industry, meaning it could raise prices and cut selections.

To avoid that situation, the deal was struck to have Constellation Brands buy Anheuser-Busch’s 50 percent stake in Crown Imports. Crown is the company that imports Corona and other products of Grupo Modelo.

Also part of the deal, Grupo Modelo will divest its U.S. business interests to Constellation Brands, including its Piedras Negras brewery that makes Corona and Modelo beer and Grupo Modelo holdings, effectively clearing concerns that Anheuser-Busch InBev will have control over U.S. markets by acquiring Grupo Modelo.

Constellation Brands, one of the world’s largest wine importers, already owns half of Crown, along with Grupo Modelo. The transaction will automatically vault Constellation into becoming one of the largest beer producer in the United States, behind Anheuser-Busch InBev and MillerCoors, which is a joint venture of Molson Coors Brewing Company (TAP) and SABMiller Plc.

In getting the Piedras Negras brewery as part of the deal, Constellation Brands had to pledge to substantially increase brewing capacity to ensure that Grupo Modelo brands remain viable competitors in the U.S. markets.

That is extrapolating some from BUD’s press release in combination with Constellation’s statement on the matter, which didn’t provide exact details of the final agreement. A-B InBev’s PR simply said that the “agreement is substantially in line with the revised transaction announced on February 14, 2013.”

Sounds like for about $5 billion, Constellation Brands is walking away with a major footprint in the U.S. alcohol business and becoming a stronger competitor to Anheuser-Busch InBev.

“The Crown acquisition represents a significant milestone for Constellation as the most transformational event in the history of our 68-year-old company,” said Rob Sands, president and chief executive officer of Constellation Brands. Sands added that sales for the company will nearly double with the new acquisitions.

Anheuser-Busch InBev gets what they wanted by getting access to the large markets in Mexico, Latin America and elsewhere that it was, well, thirsty for.

Thomson Reuters has said that the $20.1-billion deal is second in dollar-size only to the 2008 $52-billion merger of Anheuser-Busch and InBev.

With the news, shares of Constellation Brands are ahead by about 1.5 percent on the day and shares of BUD have chugged ahead a similar amount.