Shares of AMC Entertainment (AMC) surged over 45% in afternoon trading Thursday, pushing the market capitalization of the country's largest theater chain past $12 billion amid a boost from retail investors.

At market close, AMC was still up over 35% with a market value of just $11.94 billion.

AMC, which narrowly avoided bankruptcy earlier this year, belongs to a class of so-called meme stocks including GameStop (GME) and Bed Bath and Beyond (BBBY). Retail investors active on the subreddit WallStreetBets have crowded into stocks of these underdog companies in an effort to force short sellers to buy them to cover their positions. This squeeze on short sellers drives the stock prices even higher.

Brick-and-mortar video game retailer GameStop, the most notable meme stock, soared over 15% on Wednesday and added another 5% on Thursday.

Retail traders on WallStreetBets talked up AMC on Thursday, with one calling the theater a "rocket ship," another urging fellow Redditors "don't sell!" and still another asking if it "can go to the moon?"

Shares of the theater chain closed at $26.52 on Thursday, up from around $14 on May 17, when they were also rallying. The chain fell below $2 at the start of the year, a few weeks before it received a $917 million cash boost from investors to help it stave off bankruptcy.

Taking advantage of the recent gains, AMC said earlier this month that it had sold 43 million shares at $9.94 a share, raising a total of $428 million. That move came as the hashtag "AMCsqueeze" began trending on Twitter. Last week, Chinese real-estate conglomerate Wanda Group, which had been AMC's largest shareholder, cashed in on the recent rally by selling most of its shares in AMC.

The gains come after the movie theater chain was hammered by a global pandemic that resulted in a $4.59 billion loss in 2020 compared to $149 million the year prior. Recently, though, CEO Adam Aron suggested that AMC fared better than other movie theater chains.

Story continuesThis content is not available due to your privacy preferences.Update your settings here to see it.

During a call with analysts after reporting its first-quarter results earlier this month, Aron said its market share had "soared" by 25% compared to pre-pandemic levels.

“We’ve taken share from those who stayed closed or those who have gone bankrupt,” Aron said according to a Wall Street Journal report. Smaller chains like Alamo Drafthouse have filed for bankruptcy and closed a number of locations.

AMC may also benefit from increased vaccination rates, with nearly 40% of the U.S. population now fully vaccinated. Anthony Fauci, director of the National Institute of Allergy and Infectious Diseases, predicted last month that Americans could potentially go to the movies without wearing masks by the fall or early winter.

Still, even amid the waning pandemic and revived enthusiasm among short sellers, one veteran media analyst told Yahoo Finance earlier this month that AMC is in "secular decline" as more and more streaming options become available.

"There's going to be a lot of movies where you just say, I'll wait and see it at home, and the movie theater business economically, it means they're gonna make less money," said Rich Greenfield, partner at LightShed Partners, in an interview with Yahoo Finance Live.

"This is one of the reasons we have a 'sell' rating on AMC," he added.

Erin Fuchs is deputy managing editor at Yahoo Finance.

Follow Yahoo Finance on Twitter, Facebook, Instagram, Flipboard, LinkedIn, YouTube, and reddit.