Sen. Bernie Sanders, I-Vt., on Wednesday celebrated Democratic congressional candidate for New York Alexandria Ocasio-Cortez's surprise primary win over Rep. Joe Crowley, D-N.Y., saying her liberal, social democrat ideals "will resonate all over this country" ahead of the 2018 midterm elections.

"I think what it should tell the American people is that when you have candidates like Alexandria, who have the guts to talk about the real issues impacting people's lives," Sanders started an interview on MSNBC, referring to Ocasio-Cortez's policy platform and what it means for the 2018 election cycle. "She campaigned on healthcare as a right, not a privilege, raising the minimum wage to $15 an hour, demanding the wealthiest start paying their fair share of taxes, making public colleges and universities tuition-free — that is an agenda that will resonate all over this country."

Sanders, who caucuses with Senate Democrats, cited Ben Jealous, the Democratic nominee for Maryland's gubernatorial race, as another example.

[Also read: McConnell: Joe Crowley's loss shows Dems are going 'hard left']

"The message here is that when you have candidates who are talking about the real issues impacting working families and are running grass-roots campaigns, they will win in New York City," Sanders continued. "Yesterday, last night, they won in Maryland. Ben Jealous pulled off an upset, won a major victory to become the Democratic candidate for governor. We’re seeing this happening all across the country."

Ocasio-Cortez, 28, differentiated herself from Crowley, a 10-term congressman, by campaigning on a liberal platform in their race to represent New York's 14th Congressional District, including being in favor of abolishing Immigration and Customs Enforcement and rejecting corporate PAC money.

She is a member of the Democratic Socialists of America and was an organizer on Sanders' unsuccessful 2016 presidential campaign. Sanders also identifies as a democratic socialist.

Ocasio-Cortez will compete against Republican opponent Anthony Pappas, an economics and finance professor, in the general election on Nov. 6.