by Hadley Malcolm, USA TODAY

by Hadley Malcolm, USA TODAY

Best Buy's shares jumped 13% Tuesday as cost-cutting efforts widened its second-quarter profit to $266 million, up from $12 million last year.

The company reported earnings of 77 cents a share compared with 4 cents a share in a year-ago period.

The struggling retailer beat Wall Street expectations and shares rose $4.07 to $34.80. The stock is trading at levels not reached since mid-2011.

Best Buy has been cutting costs and revamping stores to offset tough competition from discounters and online retailers. Under CEO Hubert Joly, the company has instituted a price-matching policy, opened more dedicated areas for manufacturers such as Apple and Samsung and invested more to train employees.

The electronics chain is especially winning online, where sales increased 10.5% with revenue of $477 million. Best Buy said in a release that this was due to increased traffic and a higher average order value.

The sales number is even more impressive considering Best Buy's entirely new website won't launch until 2014, leading me to believe that price matching, and advertising of price matching, is closing the price perception gap with Amazon," wrote Belus Capital Advisors CEO Brian Sozzi.

Sales at stores open at least a year declined 0.6%. That's an improvement over last year though, when same-store sales were down 3.3%.

Earnings were 32 cents per share excluding one-time items, much better than the 12 cents per share that analysts had been looking for, according to a poll by FactSet.

There will be some pressure during the second half of the fiscal year due to price cuts and marketing costs, said Chief Financial Officer Sharon McCollam, as well as a temporary increase in mobile warranty costs and changes in its private label credit-card agreement with Capital One.

However, those costs will be offset by $390 million in annual savings from cost cuts, McCollam said.