After years of pummeling each other, Coors and Miller are getting hitched.

SABMiller and the Molson Coors Brewing Company, the nation’s No. 2 and No. 3 brewers, said yesterday that they would merge their operations in the United States and Puerto Rico, a move that Wall Street analysts have long expected.

The joint venture, to be known as MillerCoors, would have $6.6 billion in annual sales and eventually result in $500 million in annual cost savings, the companies estimated. It will also become a more formidable No. 2 challenger to the Anheuser-Busch Companies, which has long dominated the American market.

Peter H. Coors, vice chairman of Molson Coors, said the transaction was prompted by “profound” changes in the American alcohol business that are challenging large beer companies. Sales of domestic beers have been battered as consumers switched to wine, spirits and craft beers and imports.

Besides cost savings, the merger will create a strong portfolio of brands, from domestic brews like Coors Light and Milwaukee’s Best to import beers like Peroni and Molson Canadian.