The incident happened just before 1 a.m Friday on Forest Lane in Westbury.
According to detectives, the 34-year-old woman who lives in the home heard a noise. She proceeded downstairs, where she found 22-year-old Matthew Levine standing in her kitchen.
"I came downstairs and I heard someone talking in my kitchen and I was like who's this," said Susan Nunez, the homeowner.
Police say that when the woman ran out the front door to call police from a neighbor's home, Levine locked the front door and went upstairs to the bedroom of the woman's 8-year-old daughter, Lauryn Nunez.
There, police say he repeatedly struck her in the head with a mop while she slept. He also removed the victim's cell phone.
Nunez woke up and yelled for Levine to stop, but she says it quickly became clear that he was confused about where he was.
"I said 'I'm scared, get away from me, get out of my house,'" she said. "But he was saying, 'Get out of my house.' This isn't your house. But I didn't say that because I didn't want him to hurt me."
The neighbor kicked in the front door, but Lauryn had already run from the room and was waiting downstairs.
"I just talked to him for a couple of minutes. Tried to get him to calm down. Said the police were coming. And that everything would be all right," said Daryl Ernest, a neighbor.
Officers responded to the residence and arrested Levine in the home.
The child suffered a minor head injury, but refused medical attention.
Levine is charged with first-degree burglary, second-degree assault, fourth-degree criminal possession of a weapon and endangering the welfare of a child.