Chipotle Mexican Grill on Tuesday reported that its digital sales nearly doubled during its second quarter, fueling earnings that beat analysts' expectations.

The Mexican chain also raised its full-year outlook for same-store sales growth.

Shares of the company jumped 4% in extended trading, setting an all-time high. The company's stock has been on a hot streak recently, passing a previous record set before the chain's foodborne illness woes began in 2015. Shares are up 71% so far this year.

"We're pleased with our financial performance, which marks the sixth consecutive quarter of accelerating comps and reflects continued progress on our key strategic initiatives," CEO Brian Niccol said in a statement.

Here's what the company reported compared with what Wall Street was expecting, based on a survey of analysts by Refinitiv:

Earnings per share: $3.99, adjusted, vs. $3.76 expected

Revenue: $1.43 billion vs. $1.41 billion expected

Same-store sales growth: 10% vs. 8.33% expected

The burrito maker reported fiscal second-quarter net income of $91.0 million, or $3.22 per share, up from $46.9 million, or $1.68 per share, a year earlier.

Excluding asset impairment charges, corporate restructuring and other costs, Chipotle earned $3.99 per share, topping the $3.76 per share expected by analysts surveyed by Refinitiv.

The cost of food, beverage and packaging rose 1.1% from a year ago, primarily due to rising avocado costs. Avocado prices have skyrocketed as supply from Mexico and California has not kept up with soaring consumer demand.

"I would say that biggest wildcard in terms of our margin potential is avocados," CFO Jack Hartung said on the conference call.

Net sales rose 13.2% to $1.43 billion, beating expectations of $1.41 billion. Digital sales grew 99.1% and made up 18.2% of sales for the quarter. In March, Chipotle launched a loyalty program as part of a broader strategy to build digital engagement. This marks the program's first full quarter since it began. Niccol told analysts that the program now has 5 million members, up from 3 million last quarter.

"This is a place we're going to grow from," he said. "We're not done adding members to our rewards program."

Niccol said that they are refining how they group members to target them with promotions and experimenting with their ability to influence those members' behavior.

Since leaving Taco Bell in February 2018 to lead Chipotle, Niccol has pushed the chain to modernize with technology and menu innovation. On the conference call, he teased new menu items, including carne asada.

"It gives [customers] a reason to maybe come more often or maybe come and experience it for the first time," he said.

As customers seek more convenient options for dining, the fast casual chain has been investing in new ways to pick up digital orders with special pick-up shelves and drive-through windows called Chipotlanes. Sixteen restaurants so far have Chipotlanes.

Chipotle now offers delivery at 95% of its locations, with help from delivery partner DoorDash. Postmates and Tapingo also deliver Chipotle orders. Niccol said that delivery is "highly incremental."

"Delivery is a way for us to increase convenience, drive awareness and ultimately acquire new customers," Hartung said.

The company reported same-store sales growth of 10%, topping analyst estimates of 8.33%. Transactions at stores open at least a year increased by nearly 7%. The average check jumped by 3.5%, helped by menu price increases put in place last year. Hartung said that the chain has learned that it has some flexibility when it comes to hiking prices.

Chipotle once again raised its full-year outlook for same-store sales growth. It expects sales at restaurants open at least a year to rise at a high-single digit rate, up from a prior estimate of mid-to-high single-digit growth.

Chipotle opened 20 new locations during the quarter and closed one, bringing its total restaurant count to 2,523 stores.

The company also said Tuesday that its board has approved a $100 million stock buyback.