Warning: Graphic content

A neighborhood menace went on a bloody rampage Sunday in Astoria, Queens, cutting a woman walking to church and then stabbing a man to death and setting a homeless guy on fire before being shot by cops.

The man was wounded in a showdown that involved more than 10 squad cars and 50 officers, who chased him near his home on the normally quiet residential block of 36th Street between Astoria Boulevard and 28th Avenue.

“Everybody get down!” cops ordered as two officers, an inspector and a lieutenant, fired off seven rounds, hitting suspect James Patrick Dillon, 23, in his right leg and pelvis as he ran into a back yard, police said.

He was shot because he refused to drop his knife, cops said.

Dillon, who lives on the block with his family and has a history of severe mental illness, was taken into custody and placed in an ambulance.

Family members told cops he was off his medication when the rampage unfolded.

Two officers were taken to the hospital after Dillon doused them in the eyes with gasoline, which he slung from an empty Corona beer bottle that he fashioned into a Molotov cocktail, police sources said.

Dillon’s priors include busts for graffiti and trespassing. He had done stints in a psychiatric ward for “hearing voices,” sources said.

Dillon allegedly cracked again at 11:20 Sunday morning when he attacked a neighbor, Berta Carpio, on her way to church.

“What are you looking at, bitch?” he yelled as he rode his bike past Carpio, 39. He hurled a brick at her and pulled out a knife, her husband, Jesus Carpio, told The Post.

“My wife tried to keep moving, but he assaulted her, grabbed her by a hoodie and repeatedly slashed and stabbed her,” he said.

Dillon fled the scene. Carpio was taken to Mount Sinai Hospital Queens, where she needed five staples to close a head wound.

“I’m in so much pain. I’m really lucky to be alive,’’ she said.

“He could have killed me,’’ she added. “He needs to be removed from society — far, far away from here.”

Dillon struck again a few hours later, at 3 p.m., about a mile away when he allegedly stabbed to death George Patouhas, 55, at a liquor store the victim owned at 38-18 Astoria Blvd.

Moments later, Dillon set his sights on two other men inside the store — spraying them with gasoline that he was carrying this time in a squeeze bottle, cops said.

He allegedly tried to set both of them on fire, but succeeded in burning only one. The 62-year-old victim, who is homeless, was in critical condition at Cornell Hospital, cops said.

Additional reporting by Shawn Cohen and C.J. Sullivan