Circuit City Stores Inc., the nation's second-biggest consumer electronics chain, surprised Wall Street by posting a profit in the second quarter on strong television sales.

The Richmond retailer said Tuesday it earned $1.3 million (1 cent a share) in the quarter ended Aug. 31, compared with a loss of $11.9 million (6 cents) in the corresponding period of 2004.

Analysts surveyed by Thomson Financial had expected the company to lose 3 cents a share in the quarter.

Circuit City shares rose 92 cents, or 5.9 percent, to $16.43 on the New York Stock Exchange.

It is the first time Circuit City has posted a second-quarter profit in five years and it comes just six months after the company rejected a takeover bid by a hedge fund and announced an aggressive program of store closings and relocations.

Circuit City's sales rose almost 8 percent, to $2.56 billion in the quarter from $2.38 billion in the year-earlier period. Same-store sales, or revenue at stores open at least a year, increased 5.3 percent.

W. Alan McCollough, Circuit City's chief executive, said the retailer recorded strong sales in many categories, including portable digital audio and its online business. But it was in its critical TV category, he said, that the company "continued to drive market share increases in both plasma and LCD televisions."

Circuit City said same-store sales growth of flat-panel televisions was in the triple digits.

The gains helped offset same-store sales declines in camcorders, DVD players and desktop computers.

Donald Trott, an analyst with Jefferies & Co., called Circuit City's performance "somewhat of a pleasant surprise." But he added that the retailer benefited from lower store-relocation expenses and positive industry trends, including the iPod phenomenon.

Still, he said, it appears that Philip J. Schoonover, who spent about a decade at industry leader Best Buy Co. before Circuit City hired him last fall, is having an impact. Schoonover was promoted to president from chief merchandising officer in February.

Circuit City trails only Best Buy among the nation's consumer electronics chains.

For the first six months of its fiscal year, Circuit City lost $11.8 million (6 cents), compared with a loss of $17.9 million (8 cents) a year earlier. Sales in the first half rose about 7 percent, to $4.79 billion from $4.47 billion.

Computer monitors are displayed at a Circuit City store in Philadelphia. The company attributed its second-quarter profit to strong sales, especially in TV sets.