An assailant knifed a midtown halal cart operator and swiped a box of cash from him early Saturday, police and a witness said.

The man approached the operator — who another vendor would only identify as Mohammed — at the corner of 47th Street and Eighth Avenue around 7:55 a.m., and lured him outside by pulling on the truck’s generator, police said.

When Mohammed stepped outside the food truck to check the generator, the thief darted inside to grab the cashbox, said Sharif Ismail, 55.

“[Mohammed] got him, he was on the floor, the guy was attacking him, with his legs and arms,” Ismail said. “Mohammed was holding the box, and [the thief] was hitting him to get him off the box.”

Mohammed, who was bleeding from his arm, started screaming, “Somebody call the police,” Ismail said.

“I called the police,” he said. “Everybody was watching, nobody do nothing.”

The suspect took off, heading east on Broadway. Cops only describe him as wearing a blue shirt and blue pants.

Ismail said his cart was robbed two weeks ago but claims cops aren’t taking the robberies seriously.

“They should catch the guy,” he said. “Somebody is gonna get killed.”