American Eagle has figured out how to sell in malls, Jim Cramer says

American Eagle Outfitters has done something many other retailers have struggled with amid the rise of Amazon.com, CNBC's Jim Cramer said Thursday.

"Someone knows how to sell in a mall, and it happens to be American Eagle Outfitters," Cramer said on "Squawk on the Street."

"Who is really getting retail right? American Eagle Outfitters. They've figured out how to sell women denim bottoms, skirts, knits, woven tops. It was a very good quarter. I have to hand it to them because they're really in a groove," he said.

On Wednesday, the retailer posted better-than-expected first quarter results, logging in earnings per share of 22 cents on revenue of $749.4 million. Analysts polled by Reuters expected the firm to report profits of 18 cents a share on revenue of $731.4 million.

The company's results were mainly driven by comparable store sales of its Aerie brand, which sells intimate apparel and personal care products for women, jumping 32 percent in the first quarter, smashing the 14.9 percent rise that analysts polled by Consensus Metrix had expected.

The stock spiked 16 percent in mid-morning trade Thursday. Shares of American Eagle ended the session up more than 18 percent.

AEO in 2016Source: FactSet

— Reuters contributed to this report.

Disclosure: Cramer's trust did not own American Eagle stock when this story was published.

Correction: This story was revised to correct that analysts polled by Reuters expected revenue of $731.4 million.