The woman who built Buffalo Wild Wings into a restaurant juggernaut is leaving on her own terms after all.

Sally Smith, who as chief executive of Buffalo Wild Wings since 1996, appeared in June to have been pushed into retirement by a hard-fought proxy battle with an activist investor who called her "out to lunch."

But it turns out she was playing on a different level, having already taken steps in what would become a $2.9 billion sale of the Golden Valley-based company.

Smith was approached in February by representatives of Roark Capital Group, the Atlanta investment firm that owns more than a dozen of the nation's largest restaurant chains. Roark wanted to buy Buffalo Wild Wings, and the sides reached a deal in November, months after the company appeared to have been upended by activist investor Richard "Mick" McGuire's strategic takeover and Smith's announced plan to retire by the end of the year.

On Friday, a company spokeswoman confirmed Smith would be staying with Buffalo Wild Wings through the completion of the sale. A day earlier, Buffalo Wild Wings sent its shareholders the voting documents to accept or reject Roark's takeover offer at a special meeting scheduled for Feb. 2.

In those documents, the company asked shareholders to approve the sale. It also asked them to approve a nonbinding recommendation on Roark for special "golden parachute" payouts to Buffalo Wild Wings executives, including Smith, who will be leaving the firm after the sale. For Smith, the payout in salary, stock and benefits amounts to slightly more than $5 million.

The documents also described the 10-month process by which the deal came together, showing that Roark reached out in February and first met with Smith a month later. Smith in turn arranged for the Roark executives to meet in April the company's chairman, Jerry Rose.

At the time, Smith and Rose were nearing the end of a bitter, public battle with McGuire, whose San Francisco-based investment fund Marcato Capital had taken a sizable stake in Buffalo Wild Wings in summer 2016. McGuire was seeking to place four people on the company's board of directors at the company's June annual meeting in hopes of making changes, including selling most of the company-owned restaurants to franchisees.

McGuire's campaign against Buffalo Wild Wings and Smith grew increasingly acrimonious. In April, he wrote a letter to shareholders criticizing the company's recent stock performance and said Smith and other executives were "seemingly out to lunch as the business has deteriorated."

While their fight continued in public, Smith and Rose in early May provided the first nonpublic information to Roark, the voting documents show. There was no further contact with Roark until after Buffalo Wild Wings' annual meeting on June 2, when McGuire won some board seats, including one for himself, and Smith announced her retirement plan.

When the company's new board met for the first time in late June, Rose revealed the discussions he and Smith had with the Roark executives. Paul Brown, chief executive of Roark-owned Arby's Restaurants Inc., attended the board's next meeting in August and discussed his company's ongoing interest in Buffalo Wild Wings.

The two sides first put terms to paper on Aug. 22, with a nonbinding letter in which Roark's Arby's indicated a willingness to pay between $145 and $150 a share. That was far above Buffalo Wild Wings' $103-a-share stock price at the time.

McGuire, who had built up his stake in Buffalo Wild Wings in 2016 when its shares were priced around $155, told financial advisers to Arby's that the company would likely require a higher price. Arby's in mid-September sent another nonbinding letter indicating a range of $150 to $157 a share.

On Nov. 13, several media outlets, citing anonymous sources, reported that Buffalo Wild Wings and Roark were negotiating a deal for more than $150 a share. Those reports sent shares in the company skyrocketing.

The voting document revealed that the reports also prompted three other companies to reach out to Goldman Sachs, which was representing Buffalo Wild Wings, with interest in making a deal of their own. For about a week, Goldman Sachs executives held discussions with those three firms and four others about the prospect of buying Buffalo Wild Wings.

Over the next two weeks and through Thanksgiving weekend, the two sides traded counterproposals in which Buffalo Wild Wings sought a higher price and Roark sought assurance that Buffalo Wild Wings wouldn't seek other buyers. The final deal, announced Nov. 27 at $157 a share, contained clauses that imposed sizable financial penalties on both companies if they walked away from it. McGuire announced he would support it, and one of the largest franchisee groups of Buffalo Wild Wings restaurants also praised it.

In a statement accompanying the announcement of the deal, Smith said that Roark's ownership of Buffalo Wild Wings "will enable us to capitalize on significant growth opportunities in the years ahead."

Evan Ramstad • 612-673-4241