Investors seem to like Marvin Ellison's turnaround plans for Lowe's.

The home improvement chain Wednesday reported second-quarter earnings and revenue that surpassed analysts' expectations, but same-store sales fell short and weren't nearly as strong as rival Home Depot.

The North Carolina-based retailer also announced it will be shuttering its 99 Orchard Supply Hardware stores by year-end to "aggressively rationalize store inventory," in what was one of Ellison's first major decisions since joining the company as CEO July 2. Lowe's trimmed its full-year outlook because of this, saying it expects to incur between $390 million and $475 million in charges related to the closures in the second half of 2018.

Lowe's shares fell more than 5 percent in premarket trading on the earnings report before mounting a strong rebound. The stock was up more than 9 percent in midday trading after Ellison outlined the company's turnaround plan on an analyst call.

"For me, having worked for three different retailers, the one thing retailers do a good job of is evaluating their real estate portfolios on an annual basis," Ellison told CNBC in an interview. "Closing Orchard Supply was a very difficult decision," but it will allow Lowe's to spend shareholders' money elsewhere, including on improving supply chain, he said.

Net income for the quarter ended Aug. 3 was $1.52 billion, or $1.86 a share, compared with $1.42 billion, or $1.68 per share, a year ago. Excluding one-time items, Lowe's earned $2.07 a share, 5 cents ahead of analysts' expectations, based on a poll by Thomson Reuters.

Revenue climbed 7.1 percent to $20.89 billion, again ahead of the $20.78 billion anticipated by analysts.

Sales at Lowe's stores open for at least 12 months were up 5.2 percent, compared with a forecast for growth of 5.3 percent. Far outpacing Lowe's, Home Depot reported same-store sales growth last week of 8 percent for the second quarter.

"The company has unfortunately become distracted over the past few years. And specifically we have chased initiatives that did not add value and were not core to our retail business," Ellison told analysts on a conference call. "Our in-store technology is dated, overall execution is impaired by complexity, we have a large number of out-of-stocks in our stores that must be addressed, and we need to increase the rigor with which we evaluate capital investments."

Ellison, J.C. Penney's former CEO and a top executive at Home Depot for more than a decade, just took the helm as CEO of Lowe's last month, succeeding Robert Niblock. The home improvement retailer has since brought on a new head of stores, Joseph McFarland, who also came from Penney, along with a new head of supply chain, Donald Frieson, who came from Walmart.

Lowe's also on Wednesday named David Denton, chief financial officer of CVS Health, as CFO. His appointment is effective as soon as CVS acquires Aetna, expected to close in the second half of this year. He will succeed Marshall Croom, whose retirement was previously announced.

Ellison is anticipated by industry analysts to shake things up at Lowe's, which often falls under the shadows of Home Depot. Activist investor D.E. Shaw & Co. built a stake in Lowe's earlier this year, CNBC reported, concerned about the company's performance relative to peers.

More broadly, Lowe's has benefited as consumer confidence strengthens in the U.S. and unemployment rates remain low. Shoppers are seen investing in their homes in particular to increase property values.

"The good news is unemployment is going down, which is great for the macro-economy and that only helps us to have more customers with more disposable income to spend," Ellison told CNBC.

Looking to the full year, Lowe's said it expects to earn between $4.50 and $4.60 a share, with same-store sales climbing as much as 3 percent. The company had previously been calling for earnings per share between $5.40 and $5.50, with same-store sales increasing as much as 3.5 percent. The new forecast accounts for the Orchard closures and inventory cuts, Lowe's said.

"Overall, today's actions reflect CEO Ellison's decision to move quickly to change the business, although the lower financial outlook came in sooner than expected," Telsey Advisory Group analyst Joseph Feldman said in a research note.

Lowe's shares are up about 7 percent so far this year, bringing the company's stock value to about $87 billion. That compares with Home Depot, which has a market cap of about $232 billion and has watched its shares climb a little more than 8 percent over the same period.