Arby's is buying Buffalo Wild Wings, the chain of sports bars, for $2.9 billion.

In an all-cash deal, Arby's is paying $157 per share for Buffalo Wild Wings (BWLD), a 7% premium based on Monday's closing price. Buffalo Wild Wings stock had been much lower before rumors about a deal with Arby's surfaced two weeks ago.

The stock rose again in premarket trading Tuesday on news of the purchase agreement.

The deal will take Buffalo Wild Wings private. Arby's is owned by Roark Capital, which also has big stakes in Auntie Anne's, Carvel and Jimmy John's.

Buffalo Wild Wings, known as B-Dubs to its fans, was facing pressure from activist investors who support the deal.

Analysts have also speculated that the chain could be hurt by lower NFL ratings this season, and some of the controversy swirling around the league. But company officials, while reporting better than expected earnings recently, said they had not seen evidence of a hit from the NFL's problems.

Related: Burger sells for $10,000 in Dubai

The deal follows a trend of other mergers among restaurant chains.

Earlier this month, Au Bon Pain agreed to be bought by Panera, which itself was bought earlier this year by JAB, the owner of Krispy Kreme and Peet's Coffee.

In addition, Burger King parent Restaurant Brands (QSR) bagged Popeyes Louisiana Kitchen earlier this year, and Olive Garden owner Darden (DRI) bought Cheddar's Scratch Kitchen.

--CNNMoney's Paul R. La Monica contributed to this report.