But Chipotle, which has more than 2,400 restaurants, was hobbled in 2015 by case after case of food contamination involving E. coli, salmonella and norovirus. Last year, the company was targeted by hackers, excoriated on social media after a video of rodents in one of its restaurants went viral and pummeled by Hurricanes Harvey and Irma. In the past three years, the stock has slumped 63 percent.
The company has stumbled over leadership troubles, too. Mr. Ells’s co-chief executive, Montgomery F. Moran, relinquished his position in 2016, and Mr. Ells has been criticized for his hefty compensation.
Taco Bell can sympathize.
In 2011, the year Mr. Niccol began working at Taco Bell, the company battled a class-action lawsuit that claimed the chain’s seasoned beef taco filling was more filling than beef. The lawsuit was eventually withdrawn, but marketing experts said the company had stumbled by demanding an apology, unintentionally keeping the allegations in the public eye.
Mr. Niccol was Taco Bell’s president from 2013 to 2014 and then its chief executive starting in 2015. Under his leadership, the chain was frequently the best-performing subsidiary of Yum Brands, which also owns Pizza Hut and KFC.
In recent years, Taco Bell has teamed up with Lyft and the GrubHub online delivery service, pledged to remove artificial ingredients from most of its products, experimented with alcohol on the menu and pushed hard into the breakfast market — all moves that have elevated its reputation with the younger consumers who frequent quick-serve establishments. It has also started a more health-conscious menu called Cantina Bell and tested the Chinese market.
Taco Bell and its franchisees have more than 7,250 restaurants.
After the announcement on Tuesday, Chipotle’s stock rose nearly 12 percent, or nearly $30, to $281 a share.
Mr. Niccol will also become a Chipotle board member. Mr. Ells, who said last year that he would step down as chief executive, will become executive chairman.