Hundreds of mourners, including cops, firefighters and Jon Stewart, turned out Wednesday in Queens to say a final goodbye to Luis Alvarez, an NYPD detective who spent his final days desperately fighting to restore vital funds to 9/11 responders.

Immaculate Conception Church in Astoria was visited by several hundred as the funeral for the 53-year-old retired bomb squad officer got underway just after 10 a.m.

Alvarez died Saturday following a three-year battle with colorectal cancer, which doctors believe was brought on by his time at Ground Zero.

Three weeks before his death, Alvarez appeared alongside Stewart to make a moving plea before a House Judiciary subcommittee to replenish funds to 9/11 victims. He told lawmakers that the “fund isn’t a ticket to paradise, it’s to provide our families with care.”

Soon after he returned from Washington, DC, Alvarez’s liver shut down and doctors told him there was nothing more they could do.

“Luis could’ve spent his last days and weeks and hours with his family and loved ones, he chose to spend it making a difference,” said John Feal, founder of the Feal Good Foundation, which chose Alvarez to speak before Congress.

Feal said he hopes to return to Capitol Hill to get a bill passed in Alvarez’s name.

“He’s going to be with us when we’re back in DC. We’re going to wear him on our sleeve,” Feal told The Post.

Stewart declined to comment Wednesday at the funeral, saying he will allow the Alvarez family to speak on his behalf.

Alvarez’s son, David, and his sister, Aida Lugo, are expected to offer words of remembrance Wednesday at the funeral, while the Rev. John P. Harrington will deliver the homily.

His family requested that in lieu of flowers, donations be made to the St. Jude Children’s Research Hospital, the Kids Need More nonprofit and the FealGood Foundation.

“The Alvarez Family greatly appreciates the respect and outpouring of love and sympathy that has been shown for them in honor of Lou,” family representative Matt McCauley said in a statement.