By Svea Herbst-Bayliss

BOSTON (Reuters) - Activist investor William Ackman's hedge fund took a 9.9 percent stake in fast-casual Mexican food chain Chipotle Mexican Grill Inc <CMG.N>, buying in after the once high-flying company was battered by food-safety issues.

The billionaire manager said in a regulatory filing late on Tuesday that the company's shares, which closed at $414.07 on Tuesday, were undervalued and that he would be speaking with management.

Chipotle's shares rose as much as 8.7 percent to $450 in extended trading after Ackman's Pershing Square disclosed its ownership of 2.9 million shares in the company.

Chipotle said it learned of Pershing Square’s acquisition only on Tuesday, welcomed their investment, and appreciated the confidence they had expressed in the company.

Chipotle was tied to E. coli, salmonella and norovirus outbreaks last year and its shares tumbled 42 percent over thelast 52 weeks. And in July, Mark Crumpacker, its chief creative and development officer, was arraigned on charges of possession of cocaine. The company put him on leave.

Chipotle marks the first addition to Pershing Square Capital Management's highly concentrated portfolio in nearly a year and at a time the firm is still deep in the red after years of winning performance. A spokesman for Ackman declined to comment beyond the firm's filing.

The investment in Chipotle puts the company squarely into the path of one of the industry's most powerful investors who has often handpicked chief executive officers and joined corporate boards to try and guide turnarounds.

Last month Pershing Square, which oversees $12 billion for pension funds and other wealthy investors, sold off the remainder of its investment in railway Canadian Pacific <CP.TO>, freeing up some $1.5 billion.

With Chipotle, Ackman wades back into the fast-food sector where he has previously made successful bets on Burger King and McDonalds <MCD.N> and is currently invested in Restaurant Brands International <QSR.TO>, a fast-food chain operator.

At Chipotle he confronts a board that has come under fire for having served too long and being too chummy with top management. Ackman is no stranger to shaking up boards and already has company in the form of CtW Investment Group, which published a letter earlier this year criticizing director tenure and other matters.

Ackman resigned from the board of Canadian Pacific on Tuesday and sits on the boards of Howard Hughes <HHC.N> and Valeant <VRX.TO>.

Chipotle's biggest investors are mutual funds Fidelity and Vanguard and it is not widely owned by many hedge funds. But hedge funds have had their eye on the company before.

Four years ago David Einhorn, who runs Greenlight Capital and is widely followed, sent the company's shares tumbling after saying he thought they were overvalued.

Ackman is under pressure to perform with his investment. His Pershing Square Holding fund is off 14.3 percent for the year, posting one of the biggest losses in the industry. While the fund gained 5.8 percent in August and has made up ground since March when it was down 25.6 percent, investors and analysts are still concerned about how Ackman plans to recover from a debilitating investment in Valeant Pharmaceuticals <VRX.TO>, whose share price has tumbled 87 percent in the last 52 weeks. Ackman's average annual return is still 12 percent, one of the best records in the business.

(Reporting by Svea Herbst-Bayliss; Additional reporting by Gayathree Ganesan; Editing by Cynthia Osterman, Bernard Orr and Andrew Hay)