GREENWICH VILLAGE, Manhattan — Police arrested the man who allegedly pulled a knife on a subway rider and threatened to kill the commuter.

Edgar Rodriguez, 23, was arrested Tuesday — just two days after police released video of him with a knife on a northbound E-train. Rodriguez allegedly went on an expletive-filled tirade after a bystander on the subway spotted Rodriguez hitting his own son.

The bystander, who was on the train with his 4-year-old daughter, told Rodriguez to leave his son alone.

“He’s my son and I can do that,” the man responded.

Rodriguez allegedly pulled out a knife and continued to shout at the bystander.

“Your daddy will get killed on this train,” he said, according to police.

He was caught on video shouting at the rider and waving a knife at him repeatedly at the West 4th Street station. He pushed his own child’s stroller onto the subway platform and then stood in the train’s doors and yelled, even as the doors repeatedly closed on him. Rodriguez also allegedly spat on the subway rider.

Police charged him with endangering the welfare of a child, menacing and criminal possession of a weapon.