Adam Gray/Bloomberg via Getty Images

Dollar General $DG -0.61% raised its full-year profit forecast on Tuesday after posting first-quarter earnings that topped Wall Street expectations, as consumers continued turning to the discount retailer for low-cost essentials.

At $2.00 per diluted share, quarterly earnings cleared the $1.89 analyst consensus tracked by The Wall Street Journal, representing a 12.4% improvement over the $1.78 reported in the same quarter a year ago.

Net sales rose 3.4% to $10.79 billion, driven by new store openings and same-store sales growth of 2.0%. Same-store sales growth reflected a 1.4% increase in customer traffic and a 0.5% rise in average transaction amount, the company said. The retailer's bottom line came in at $444.1 million, a gain of roughly $52 million compared with the year-earlier period's $391.9 million.

Gross margin widened by 65 basis points to reach 31.6%, with favorable inventory dynamics — including stronger markups and reduced shrink and damage costs — powering an operating profit of $638.5 million, a 10.8% year-over-year increase that absorbed the drag of unusually harsh winter weather and elevated fuel expenses.