Home improvement giant Home Depot (HD - Get Report) on Tuesday reported second-quarter results that beat analysts forecasts, though warned that future earnings growth will look less solid in part due to falling lumber prices and the potential impact of tariffs on consumer activity.

The Atlanta-based company posted net income of $3.5 billion, or $3.17 a share, vs. $3.5 billion, or $3.05 a share, in the comparable year-earlier period. Analysts polled by FactSet had been expecting earnings of $3.09 a share. Sales came in at $30.8 billion vs. analysts' forecasts of $31.022 billion. 

Same-store sales, a key metric among brick-and-mortar retailers, rose 3% vs. expectations of 3.4%.

Our Q2 earnings news release is now available: https://t.co/mnTSAYMK4J $HD #HDEarnings pic.twitter.com/B420pOwoE9

— The Home Depot (@HomeDepot) August 20, 2019

"We are encouraged by the momentum we are seeing from our strategic investments and believe that the current health of the U.S. consumer and a stable housing environment continue to support our business," CEO Craig Menear said in a statement.

"That being said, lumber prices have declined significantly compared to last year, which impacts our sales growth. As a result, today we are updating our sales guidance to account primarily for continued lumber price deflation, as well as potential impacts to the U.S. consumer arising from recently announced tariffs," Menear said.

Home Depot said it now fiscal-year sales to grow approximately 2.3%, and comparable sales to increase 4%. The company reaffirmed its earnings-per-share growth guidance for the year of $10.03. Analysts polled by FactSet had been expecting full-year earnings of $10.11.

Shares of Home Depot gained 4.5% to $217.39 in trading on Tuesday.

Home Depot stock has risen more than 18% year to date, putting it well ahead of rival Lowe's (LOW - Get Report) . Lowe's had the lead for much of the first half of the year, thanks to optimism about its turnaround efforts, a new management team and strategic changes, but is now up just 1% in 2019.

Lowe's reports its quarterly earnings on Wednesday. Analysts are currently expecting earnings per share of $2.

However, TheStreet's Trifecta Stocks contributors Chris Versace and Bob Lang wrote on Tuesday that they feel the stock has more upside.

"Recently the stock took a hit along with the rest of retail, but it seem the bulls have stemmed the tide," the duo wrote. "The recent 10% drop presents an excellent buying opportunity here, so if you're light on the name, it's time to bulk up for the holidays."

Home Depot is a holdings in Jim Cramer's Action Alerts PLUS member club. Want to be alerted before Jim Cramer buys or sells HD? Learn more now.

Save 57% With Our Labor Day Sale. Join Jim Cramer's Action Alerts PLUS investment club to become a smarter investor! Click here to sign up!