Best Buy Co Chief Executive Brian Dunn suddenly resigned from the company during an investigation into allegations of personal misconduct, the electronics retailer said on Tuesday.

The surprise departure comes as Best Buy, the world's largest electronics retailer, has struggled because consumers are purchasing more electronics online and can easily compare competitors' prices on their mobile devices while looking at a product in a Best Buy store.

Certain issues were brought to the board's attention regarding Mr. Dunn's personal conduct, unrelated to the company's operations or financial controls, and an audit committee investigation was initiated. Prior to the completion of the investigation, Mr. Dunn chose to resign, said Claire Koeneman, an external spokeswoman for Best Buy. She would not comment on what the issues were.

Dunn could not be reached for comment.

In a statement issued by Best Buy earlier on Tuesday, Dunn said, I have enjoyed every one of my 28 years with this company, and I leave it today in position for a strong future.

Best Buy said that G. Mike Mikan, a board member, would serve as interim CEO and that a search for a new CEO was under way.

The timing of Dunn's departure came as a surprise to Wall Street. Only two weeks ago, Dunn presided over the company's announcement of a plan to close 50 of its 1,100 large stores and cut 400 jobs.

But critics have complained that under Dunn's tenure, which lasted less than three years, Best Buy became a showroom for and other online retailers, with consumers going to Best Buy stores to check out electronics like high-definition televisions, then buying them elsewhere for less.

The company, a bellwether for the consumer electronics industry, reported declines in same-store sales in six of the last seven quarters, including during the 2010 holiday season when it bet on technology like 3D television that was not embraced by consumers.

Despite offering bigger discounts and free shipping in the 2011 holiday season, Best Buy suffered a 2.4 percent drop in same-store sales in the quarter ended March 3, including a 2.2 percent decline at U.S. stores open at least 14 months.

I hate to be rude, but I think he (Dunn) was doing a terrible job. This is a company that had a sales guy in charge, and I just don't think they are well positioned to deal with the onslaught from the Internet, said Michael Pachter, an analyst at Wedbush Securities.

They have a big disadvantage to the Internet retailers because they have a big cost structure. So they need a guy who can fix that rather than trying to sell more stuff.

Koeneman said the company was looking internally and externally for a permanent CEO and that Mikan would be considered for that post.

Mikan has been a Best Buy director since April 2008. He formerly served as executive vice president and chief financial officer of UnitedHealth Group. At one point, he was considered a potential successor to UnitedHealth's CEO but left the U.S. health insurer to lead a private equity fund

Best Buy's stock rose as much as 4.8 percent to $23.74 after the news that Dunn would be replaced, but the shares ended down 6 percent at $21.32.

(Additional reporting by Mihir Dalal, Martinne Geller, Phil Wahba and Jessica Wohl; Writing by Brad Dorfman; Editing by Gerald E. McCormick, Tim Dobbyn and Steve Orlofsky)