A knife-wielding burglar bound an Upper West Side family with electrical tape in a home-invasion robbery Thursday afternoon, sources said.

The suspect, a 30-year-old gang member on parole for burglary, was waiting inside the lobby of the tony apartment building on West 78th Street near West End Avenue at about 3 p.m. when a 24-year-old woman and her mother walked inside, according to police sources.

The suspect, who was wearing Army fatigues, then pushed the mother and daughter to the floor and held them there with a knife.

He forced them into their apartment and tied them up with electrical tape, cops said.

The suspect then demanded their credit cards and other financial records, the sources said.

He was interrupted when there was a knock on the door from the 52-year-old father of the family.

The suspect grabbed the daughter — who was still bound with electrical tape — held a knife to her throat and ordered her to answer the door, police sources said.

He then ordered the father into the apartment and tied him up, cops said.

The suspect left with their credit cards and told them he’d kill them if the cards didn’t work, a police source said.

The 24-year-old was able to get to her cellphone and call police, who arrested the man minutes later on the street.

At the precinct, the suspect tried to assault several police officers, who tased him, cops said.

He was taken to Bellevue Hospital to be treated and charges against him are pending.

Police sources said he had three prior arrests and was on parole for burglary.