Supervalu’s new CEO, Sam Duncan, has come out of the gate strong, as a cost-cutting offensive sparked first-quarter profits that far exceeded Wall Street’s expectations and drove the company’s stock up almost 17 percent Thursday.

Duncan took over in the wake of a transformational $3.3 billion deal announced in January that essentially halved the size of Eden Prairie-based Supervalu, ending months of speculation over the struggling grocer’s future. Big job cuts after the deal and associated cost savings paved the way for Thursday’s earnings surprise.

But Supervalu still must prove it can turn around sales that have been declining for years, wilting under tough competition. Indeed, same-store sales were down again in key business divisions during the first quarter.

Duncan acknowledged the challenge in a conference call with stock analysts Thursday. “We still have a great deal of work ahead of us, but the management team and I are laying the foundational pieces that have to be in place. … In the last 16 weeks, it’s clear the company has a newfound sense of urgency.”

The quarter ended June 15 marked the first full quarter for Supervalu under Duncan, a veteran retail executive. He started the job soon after Supervalu announced the sale of its five largest supermarket chains to an investor group led by Cerberus Capital Management. Cerberus also took a large minority stake in the new Supervalu.

The company, which owns the Cub Foods grocery chain, Thursday reported a net loss from continuing operations of $105 million, or 43 cents a share, including $139 million in after-tax charges related to the company’s recent restructuring.

But investors knew that those charges, which include employee severance and asset write-downs, were coming. Without them, Supervalu earned $34 million, or 14 cents a share. Analysts polled by Thomson Reuters were on average expecting a profit of 6 cents per share. Supervalu’s quarterly sales of $5.16 billion were just shy of analysts’ estimates of $5.17 billion.

Supervalu’s stock closed Thursday at $7.91, up $1.14, or 16.8 percent. It was the biggest gainer on the Standard & Poor’s 400 Midcap Index. A year ago, Supervalu shares were floundering around $2, lows not seen in 30 years.

Much of Supervalu’s first-quarter improvement came from cost-cutting. “The company showed nice progress in ripping out administrative costs and reinvesting in price [cutting prices], which should eventually result in improved top line results,” analyst Jonathan Feeney of Janney Capital Markets wrote in a research report.

Job cuts made up much of the cost cutting, though the company’s decentralization of operations from headquarters to individual chains helped, too. After the Cerberus deal closed in March, Supervalu announced it would cut 1,100 corporate positions — just over a third of its office workforce — including 600 jobs in Minnesota. Most of those cuts have occurred.

Duncan outlined ways to boost sales Thursday, down to details like better banana displays at Save-A-Lot, Supervalu’s national chain of discount supermarkets. He said key sales trends had improved sequentially from Supervalu’s last quarter, but were still down compared to a year ago.

“The key is going to be eventually turning sales around,” said Ken Perkins, a stock analyst at Morningstar Inc. “At some point, the top line is what matters. You can’t cut your way to prosperity.”

Sales in Supervalu’s largest business unit, food wholesaling, were $2.46 billion, down from $2.48 billion a year ago. The division’s operating earnings, exclusive of charges, were $69 million, up from $68 million a year ago.

Save-A-Lot had sales of $1.27 billion, down from $1.29 billion, while operating earnings were $57 million compared with $59 million a year ago. The chain’s earnings were down partly because it has been cutting prices to become more competitive.

Supervalu’s five traditional retail chains, including Cub, recorded sales of $1.43 billion, down 3 percent from a year earlier. But retail food’s operating earnings for the quarter were $43 million, much better than $9 million a year ago.

“We are in the process of improving our operations,” Duncan told analysts. “But we are pleased with our first-quarter results.”