Shares of Lowe’s Companies Inc. reversed to a gain Tuesday, after the home-improvement retailer beat fiscal first-quarter profit expectations, and while same-store sales missed forecasts they outperformed rival Home Depot Inc. for the first time in more than two years.

And while Lowe’s lowered its full-year guidance ranges for earnings and revenue, they still bracketed Wall Street projections.

The stock
LOW,
+1.72%
jumped 2.7% in morning trading. That reverses an earlier loss, after the opening bell, of as much as 0.3%, and a drop of as much as 3.4% suffered premarket, just moments after results were released.

Lowe’s reported net income for the quarter to May 5 of $2.26 billion, or $3.77 a share, after income of $2.33 billion, or $3.51 a share, in the same period a year ago. Net income fell while earnings per share (EPS) increased as the number of shares outstanding used to calculate EPS dropped 9.8% to 597 million.

Excluding nonrecurring items, such as an asset-sale gain, adjusted EPS of $3.67 beat the FactSet consensus of $3.44.

Total sales declined 5.5% to $22.35 billion, above the FactSet consensus of $21.60 billion.

Same-store sales, or sales of stores open at least a year, declined 4.3%, compared with the FactSet consensus for a 3.4% drop.

D.A. Davidson analyst Michael Baker said that while same-store sales missed expectations, they were better than rival Home Depot Inc.’s
HD,
+1.47%
first-quarter U.S. same-store sales drop of 4.6%.

“This is the first time [Lowe’s] beat [Home Depot] in the U.S. since [the fourth quarter of 2020],” Baker wrote in a note to clients.

Cost of sales fell less than sales, down 5.1% to $14.82 billion, as gross margin contracted to 33.7% from 34.0%. The value of merchandise inventory as of May 5 fell 3.5% from a year ago to $19.52 billion.

During the quarter, Lowe’s said it spent $2.1 billion to repurchase 10.6 million shares and paid out $633 million in dividends.

“We are pleased with the performance of our business despite record lumber deflation and unfavorable spring weather,” said Chief Executive Officer Marvin Ellison. “Although we delivered positive comparable sales in Pro and online for the first quarter, we are updating our full-year outlook to reflect softer-than-expected consumer demand for discretionary purchases.”

For fiscal 2023, the company lowered its guidance ranges for adjusted EPS to $13.20 to $13.60 from $13.60 to $14.00 and sales to $87 billion to $89 billion from $88 billion to $90 billion. The outlook for same-store sales was revised to down 2% to down 4% from flat to down 2%.

Meanwhile, Wall Street’s full-year estimates were within the lowered guidance ranges, as the FactSet consensus for EPS was $13.56. The estimate for sales was $88.36 billion and for same-store sales was a decline of 2.2%.

Lowe’s results came less than a week after Home Depot reported a first-quarter profit beat — but sales missed expectations. Home Depot also lowered its full-year outlook.

Lowe’s stock has gained 4.7% year to date, while Home Depot shares have dropped 6.4% and the S&P 500 index
SPX,
-1.12%
has advanced 9.0%.