Shares of Urban Outfitters Inc. surged in early trading Wednesday - the most since the Philadelphia-based apparel company went public 24 years ago - after its Free People and Anthropologie chains performed better than had been predicted, helping offset a slump at its flagship business.

Earnings in the quarter were 44 cents a share, the company reported Tuesday. That topped the 36-cent average of projections. Early Wednesday, the stock climbed as much as 27 percent to $21.31 in New York, the biggest intraday gain since November 1993.

In delivering the results, chief executive Richard Hayne highlighted "encouraging fashion apparel trends," which could help boost the company's performance in future quarters. Hayne has been working to improve sales in a retail environment plagued by store closures, slow fashion trends, and discount-hungry shoppers. The company has been investing in growing internationally, improving digital offerings and expanding its wholesale market, but progress has been slow.

This quarter showed some improvement as same-store sales, a key metric, also topped estimates. While they declined 4.9 percent in the period, the result wasn't as bad as the 6.4 percent drop seen on Wall Street, according to Consensus Metrix. Free People, which contributes about 20 percent of total revenue, saw same-store sales climb 2.9 percent, the only brand that saw growth in the quarter.

Anthropologie's same-store sales dropped 4 percent, though that was far better than the 8.1 percent seen by analysts. Urban Outfitters' namesake brand saw that metric fall 7.9 percent, slightly worse than projections. Total net sales of $872.9 million handily exceeded estimates of $858 million.

Shares of Urban Outfitters had plunged 41 percent this year through Tuesday.