Image source: Chipotle Mexican Grill.

If you look at a historical stock chart for Chipotle Mexican Grill (NYSE:CMG), one of the things you may notice is that its share price fell dramatically in the middle of 2012.

After reporting that same-store sales increased only 8% in the second quarter of that year, compared to an expected 10.2% rise, shares of the restaurant chain fell 20% on a single day. It was the company's largest single-day drop ever up to that point.

"We believe it is time to take gains from the last 1-2 years, and adopt a more cautious stance toward the stock's 12-month outlook," said Janney Capital Markets analyst Mark Kalinowski at the time, who reduced his rating on Chipotle to neutral from buy.

Investors agreed. By October, Chipotle's stock had lost 46% of its value, falling from a high of $440 a share in April down to $238 a share six months later.

But far from cowering out of fear that investors were fleeing, Chipotle's management team exploited the perceived crisis by buying back stock. It repurchased $135 million worth of its shares during the fourth quarter of 2012, equating to a sixfold increase over the prior-year period.

CMG Chart

CMG data by YCharts.

As Chipotle's chief financial officer Jack Hartung observed on that quarter's conference call:

We were opportunistic with our share buybacks in 2012 and have invested about $229 million buying back our stock since January 1, 2012, up until today. During the first six months of 2012, we repurchased about 74,000 shares for about $29 million. Then from July 1 until today, we invested another $200 million to repurchase about 683,000 shares. We still have about $80 million remaining on our current $100 million authorized share buyback and our board has already approved an additional $100 million.

The benefit of hindsight reveals how shrewd this was. Chipotle's shares went on to triple in price by the middle of last year. And even after they've given back much of this gain over the past six months, they're still nearly twice where they were when Chipotle doubled down on share buybacks in 2012.

I don't bring this story up to rehash the past. I do so instead to add context to Chipotle's latest decision to once again exploit (in a good way!) a crisis in order to buy back stock on the cheap.

After a food-borne illness outbreak last November sent its shares tumbling by 40%, Chipotle has repurchased nearly 2 million shares of its stock. By doing so, the chain has reduced its outstanding share count by 5.4%.

CMG Average Diluted Shares Outstanding (Quarterly) Chart

CMG Average Diluted Shares Outstanding (Quarterly) data by YCharts.

And more is on the way. In a filing with the Securities and Exchange Commission, Chipotle disclosed last Wednesday that its board of directors has hiked its buyback authorization by an additional $100 million.

It remains to be seen if Chipotle can recover fully from last year's E. coli outbreaks. I believe it will, largely because most major fast-food chains have weathered similar crises in the past. But even if it doesn't, this is still the right move.

If buybacks are a legitimate way to both return capital to shareholders and boost value, then you should use them when shares are cheap. As Warren Buffett has said in the past: "You pay a very high price in the stock market for a cheery consensus."