A man who had been speaking incoherently held his 3-year-old daughter threateningly at an open third-floor window during a standoff with police before officers entered the house in North Philadelphia and rescued the girl and her 6-year-old brother, authorities said.

The 41-year-old father, whose name was not immediately released, put up a struggle when police tried to take him into custody, punching and kicking them, Chief Inspector Scott Small told reporters at the scene along the 2200 block of North Howard Street. No one was injured during the 2-hour-long standoff.

Police went to the house about 12:40  a.m. Tuesday after reports of a man screaming from the third floor.

Officers tried to get the man to leave but he refused and police declared a barricade situation at 1:12 a.m.

Small said the man was acting irrationally and speaking incoherently.

A SWAT team and a hostage negotiator arrived, but when the man refused to come out, concerns grew about the safety of the children after he held the girl threateningly at the open third-floor window.

"The entire time you could hear children screaming in the background," Small said. "So we were afraid one or more of the children may be harmed, so police went inside."

The man, who was taken into custody about 2:45 a.m., was taken to a hospital for a mental-health evaluation, officials said.

The children were reunited with their mother.