The nation’s largest dollar-store retailer on Tuesday posted better-than-expected sales and earnings results, fueled by a boost in customer traffic and spending in its stores.

Dollar Tree’s net income increased $68.3 million to $239.9 million for the quarter ended Oct. 28. Earnings per share increased 40.3% to $1.01, compared to $0.72 in the year-ago period. Analysts on average had expected earnings of 90 cents per share.

Consolidated net sales increased 6.3% to $5.32 billion from $5.00 billion last year. Analysts had forecast sales of $5.28 billion

Same-store sales increased 3.2%, more than analysts expected, driven by increases in average ticket and comparable transaction count. By brand, same-store sales rose 5% for Dollar Tree and 1.5% for Family Dollar.

“Our team delivered terrific results in the third quarter,” stated Gary Philbin, president and CEO. “Same-store sales accelerated in both the Dollar Tree and Family Dollar banners; we delivered a 120 basis point improvement in enterprise operating margin; and earnings per share grew more than 40% from the prior year.”

During the quarter, the company opened 169 stores, expanded or relocated 23 stores, and closed six stores. It ended the period with a total of 14,744 stores.

Analyst Neil Saunders, managing director of GlobalData Retail,…