Dance Video by Alexandria Ocasio-Cortez Inspires Delight. Condemnation? Not So Much.

The day before Alexandria Ocasio-Cortez, 29, officially took office in Washington as the youngest woman ever elected to the House of Representatives, video footage from her college days suddenly appeared on the internet.

If the video showing her dancing and twirling barefoot on a rooftop was meant to be an embarrassing leak, it backfired badly.

The dance video — a mash-up of 1980s dance moves from the movie “The Breakfast Club” and the music of “Lisztomania,” by the French band Phoenix — proved to be too endearing to many social media users. Some also saw a right-wing effort to undermine Ms. Ocasio-Cortez, a liberal Democrat known as “AOC” among her fans.

A Twitter user identified as Richard Burr wrote: “I love how Alexandria Ocasio-Cortez has turned American politics into a live action Footloose. People dancing!? Oh the horror! Where will it end?”

Since Ms. Ocasio-Cortez, a self-described Puerto Rican “girl from the Bronx,” was elected in New York in November, she has been a target of conservatives and far-right groups. She won political notice after jolting the Democratic establishment by defeating an incumbent congressman to win the primary for New York’s 14th Congressional District in a virtual landslide in June.

But her origin story, which saw her go from being a bartender to a lawmaker, has been dismissed by some on the right. Her clothes have come in for particular scrutiny, with a conservative journalist criticizing a fitted coat and jacket she wore as “too nice for a girl who struggles.”

The hosts of “Fox and Friends” have mocked her for saying she could not afford an apartment in Washington until she received her salary, disputing the menial savings she cited. She has been something of a lightning rod in her own party as well. Claire McCaskill, the departing Democratic senator from Missouri, called her a “thing” and “a bright shiny new object” in a recent CNN interview.

When Ms. Ocasio-Cortez, dressed in white in homage to suffragists and pioneering women in politics, was sworn in on Thursday, Republicans booed her.

To which she replied on Twitter: “Over 200 members voted for Nancy Pelosi today, yet the GOP only booed one: me. Don’t hate me cause you ain’t me, fellas.”

When the dance video emerged, many internet users wondered what exactly was incriminating about a windswept Ms. Ocasio-Cortez twirling enthusiastically. The footage was from a four-minute-20-second dance video made by Boston University students in 2010, when Ms. Ocasio-Cortez was an undergraduate.

A dubbed and edited version of the original footage surfaced when a Twitter account called AnonymousQ1776 published it online. “Here is America’s favorite commie know-it-all acting like the clueless nitwit she is,” read the tweet from AnonymousQ1776, which incorrectly described it as a video from her high school days. The account has since been deleted.

The lyrics speak of watching mania “grow like a riot.” Eric Calvin Baker, who can be seen dancing in the video with Ms. Ocasio-Cortez, wrote on Twitter that the scrutiny on the new lawmaker echoed the “mania” after which the song is named.

Many social media users came to Ms. Ocasio-Cortez’s defense, and the video has inspired memes.

Molly Ringwald, one of the stars of “The Breakfast Club,” declared on Twitter that she was “in the club.” The actress Ally Sheedy, whose dance moves Ms. Ocasio-Cortez imitates in the video, also endorsed the homage.

A brand-new Twitter account called “AOC Dances to Every Song” mashed Ms. Ocasio-Cortez’s joyous dance moves with music as varied as “Gangnam Style,” China’s national anthem and Selena Gomez’s “Kill Em With Kindness.” (But perhaps it aligns best with Lou Bega’s “Mambo No. 5.”)

The musician Jonathan Mann overlayed the video with lyrics in support of universal health care, a core campaign issue for Ms. Ocasio-Cortez, a former community activist, member of the Democratic Socialists of America and Bernie Sanders campaign organizer.

And Lawrence Lessig, a professor of law at Harvard Law School, had been using Ms. Ocasio-Cortez’s video among other “Lisztomania” and “Breakfast Club” mash-ups to illustrate the concept of fair use in his lectures, he said in an email on Friday.

“That may explain why she seemed so familiar to me when she appeared on the national stage,” he wrote, adding, “Obviously, her coolness long predates her political brilliance.”

Alluding to the culture of reckoning that followed the “Me Too” era and the double standards that affect women and men in the public sphere, the comedian and actor Kumail Nanjiani tweeted:

“Man sexually assaults women in high school: ‘That was so long ago!’ Woman dances in high school: ‘We must set her ablaze.’”