Gap Inc. (GPS - Get Report)  joined the short list of retailers groping their way out of darkness, reporting strong second-quarter earnings on Thursday, Aug. 17.

For the quarter ending July 29, Gap posted earnings of 68 cents per share, more than double the 31 cents per share earned in the same quarter 2016 and above consensus expectations. Sales of $3.8 billion, down 1.4% year over year, also exceeded expectations. Analysts polled by FactSet expected Gap to report earnings of 52 cents on sales of $3.77 billion.

The company's lower-priced Old Navy line, which has bolstered the stock in recent quarters, reported same-store sales increasing 5%, while the Gap and Banana Republic brands' same-store sales fell 1% and 5%, respectively. All performed better than in 2016, when Old Navy same-store sales were flat, Gap's fell 3% and Banana Republic's fell 9%. 

San Francisco-based Gap's shares rose 10% to $25.05 in after-hours trading. Shares closed Thursday at $22.68, up 1.3% year to date, compared with the S&P 500's increase of 10.2% year to date.

Despite the difficult retail environment, a few of Gap's peers, including Target Corp. (TGT - Get Report) and Nordstrom Inc. (JWN - Get Report) , managed decent quarters. Still, the SPDR S&P Retail ETF is down 13.4% in 2017.

Amazon.com Inc.'s (AMZN - Get Report) dominance over all facets of retail has made Gap vulnerable, like many retailers and clothing companies, Jefferies analysts wrote last month, identifying only Walmart Stores Inc. (WMT - Get Report) , Hain Celestial Group Inc. (HAIN - Get Report) , Foot Locker Inc. (FL - Get Report) and Advance Auto Parts Inc. (AAP - Get Report) that are unduly weighed down by Amazon fears.

Nordstrom is considering going private, while Abercrombie & Fitch Co. (ANF - Get Report) failed to find a buyer. Scores of retailers have filed for bankruptcy this year, with others closing stores.

More of What's Trending on TheStreet: