The man charged in the fatal beating of his 3-year-old step daughter over the weekend allegedly tried to make eat her own soiled underwear before flipping out and banging her head against a bed frame, police said Monday.

Kelsey Smith, 20, was watching Jeida Torres and her 5-year-old brother, Andrew, in their second-floor apartment inside a Bushwick homeless shelter on Saturday when the little girl had an accident just before 4 p.m., according to police.

Smith allegedly took off the dirty underwear and held it up to both Jeida and Andrew's faces, telling them to eat it. When the children refused to touch it,he turned violent, police said.

Smith allegedly banged little Jeida's head up against a bed frame and choked her, police said. When Andrew tried to intervene he was beaten as well, Brooklyn Borough President Eric Adams said in a statement Sunday.

Both children were found severely bruised..

The children lived with Smith and their mother, who were recently married, police said.

Smith was charged with felony assault and acting in a manor injurious to a child for allegedly beating Jeida.

Jeida's death was ruled a homicide by the medical examiner Monday, caused by "blunt impact injuries" of the head and torso, said Julie Bolcer, a spokeswoman for the agency. Charges were expected to be upgraded, police have said.

Smith allegedly fled the apartment but was picked up inside a relative's home in Queens, a law enforcement official with knowledge of the case said. He was taken to Elmhurst Hospital Center suffering from self-inflicted wounds and transferred early Monday to Bellevue Hospital Center.

Both children were taken to Wyckoff Hospital Medical Center where Jeida was pronounced dead and Andrew was listed in stable condition, police said.

Smith was not charged in Andrew's beating, but police said the case was still open and more charges could be pending.

Smith could not be reached for comment and it could not be determined if he had retained an attorney.

On Sunday, Adams called on the Department of Homeless Services to complete a full investigation into Jeida's death and how the agency handles domestic violence cases in all shelters.

"The death of a child is a very tragic incident," Camille Rivera, deputy commissioner for DHS, said in a statement on Sunday. "We are working closely with other city agencies to determine how this occurred. We will continue to do everything possible to ensure the safety of all children who are in our shelters."