The flagging presidential campaign of Vermont Sen. Bernie Sanders got an adrenaline boost Saturday when lefty darling Rep. Alexandria Ocasio-Cortez formally endorsed the 78-year-old democratic socialist for commander in chief.

“It wasn’t until I heard of a man by the name of Bernie Sanders that I began to question and assert and recognize my inherent value as a human being,” Ocasio-Cortez said in an emotional rally speech at Long Island City’s Queensbridge Park, before a crowd the Sanders campaign estimated was more than 25,000.

“Bernie Sanders fought for us.”

Sanders suffered a heart attack Oct. 1 while stumping in Nevada, forcing him to suspend his campaign for two weeks — a serious blow to a candidate who has suffered steep party polling losses in recent months.

He now commands 15 percent of the vote, according to RealClearPolitics, down from a high of 24 percent in March, as he and Massachusetts Sen. Elizabeth Warren battle to win the Democratic Party’s left wing.

“He’s the godfather of the movement,” said an Astoria resident, 26, who gave his name as Tommy, decked out in a “Feel the Bern” hoodie. “He has a vision for the future. I can trust him.”

But Maomi Imbrog, 63, a Sanders supporter in 2016, expressed doubt.

“I’m wavering between Elizabeth Warren and Bernie,” she said. “I love Bernie, but I just don’t know if he can win.

“He could die before he even gets elected,” she said.

Filmmaker Michael Moore and Tiffany Cabán, the AOC-backed candidate who came within 60 votes of defeating Borough President Melissa Katz this summer for Queens district attorney, also took the stage to boost Sanders.