Alexandria Ocasio-Cortez, a former campaign organizer for Bernie Sanders, pulled off a stunning upset in New York City on Tuesday by defeating Rep. Joseph Crowley, D-N.Y., a member of party leadership who was considered all but a shoo-in.

Crowley, 56, a 10-term incumbent from Queens and fierce Trump-basher, was a steady fundraiser for fellow Democrats and was thought by some to be a future speaker of the House.

His defeat left no clear potential choice in the House to succeed Rep. Nancy Pelosi, D-Calif., as the party's leader. Further, it exposed deepening divisions within the party as the liberal wing flexes its muscles in the primaries -- pressuring the establishment to back big-government policies like Medicare for All and guaranteed jobs.

There were times that Crowley's campaign in New York’s 14th Congressional District showed signs of fragility. The New York Times editorial page, after his loss, reported that he ran a lackluster campaign that bordered on complacency. The paper pointed out that he debated his opponent only once.

Ocasio-Cortez, 28, who is from the Bronx, is a member of the Democratic Socialists of America and ran a low-budget campaign where she was outspent by an 18-1 margin.

"We have had our country on autopilot and we’ve been accepting what’s been happening," she told Refinery29 earlier this month. "And what's happening in this country is indicative that we need new leadership. We need new leadership in the Democratic Party and we need new leadership in the country."

Among her issues is expanding the Medicare program to people of all ages and abolishing Immigration and Customs Enforcement (ICE). She recently went to Tornillo, Texas, to protest against policies that have separated parents from their children at the U.S.-Mexico border.

“We beat a machine with a movement, and that is what we have done today,” Ocasio-Cortez said. “Working-class Americans want a clear champion and there is nothing radical about moral clarity in 2018.”

Her win drew comparisons to when then-House Majority Leader Eric Cantor, a Republican, lost to unknown Dave Brat in 2014, and raised questions for Pelosi.

“In the short term, Pelosi may have crossed another potential challenger off of her list, but the bigger picture can’t be good for the existing Democratic leadership structure,” Jim Newell wrote in Slate. “Crowley, for all his accumulated power, just got taken out on the mantra of generational change. This presents an argument, for Pelosi’s detractors in the conference, that the rest of the leadership should follow suit.”

Politico wrote that although a rival to Pelosi was defeated, Ocasio-Cortez represents a “reminder of the generational demands for change at the top of the party hierarchy,” and her victory will likely send a “shudder through the moderate wing of the party.”

The National Republican Campaign Committee celebrated the defeat of "poor Joe Crowley."

"House Democrats, hoping for a post-Pelsoi era, are now left leaderless," NRCC spokesman Matt Gorman said. "The only person happier tonight than Nancy Pelosi is the NRCC."

Pelosi, for her part, described Crowley as "an unwavering champion for America’s working families for almost two decades" who "brought principled, unifying and forward-looking leadership to the historic challenges of the Trump Administration" as the Democratic caucus chair.

"I salute Chairman Crowley for a formidable legacy of achievement for the people of New York," Pelosi concluded. "I congratulate Alexandria Ocasio-Cortez on her victory."

Fox News' Paul Steinhauser and the Associated Press contributed to this report.