An off-duty female cop shot a man who allegedly tried to rob her at Penn Station Wednesday night, police sources told the Daily News.

The cop was with her husband — also an off-duty NYPD officer — when an 32-year-old man allegedly tried to rob her inside a Long Island Rail Road train in Penn Station near Eighth Ave. and W. Third St.

A scuffle started on the train and then spilled out onto the Penn Station platform, where the female officer fired off one shot, striking the man in the shoulder.

The married cops were on their way home, sources said, adding the alleged robber was taken into custody and was in stable condition at a nearby hospital. Charges against him were pending, the sources said.

See Full Page