The York Dispatch reported that Ummad Rushdi, 30, of York, made the remark as he was led from the courtroom, and it was unclear to whom he was speaking.
Rushdi is accused of taking 7-month-old Hamza Ali from the home of Rushdi's parents in Upper Darby in early August, and police believe he disposed of the child's body.
His lawyer argued there was no evidence of kidnapping or second-degree murder, which is murder committed during the course of another felony.
Hamza's mother, Zainab Gaal, testified at the hourlong preliminary hearing in Upper Darby on Monday, saying Rushdi "always had issue(s)" with the child.
"He would say he's an idiot baby - a negative-energy baby," Gaal testified. "That he doesn't belong here."
She said Rushdi told her he was going to take the boy away.
"I told him, 'You can't take him away without my permission,'" Gaal testified. "He was quiet for a few seconds, then he said he could get away with murder."
Gaal, Rushdi and the child lived in a home in the York suburbs with Rushdi's brother and others. Rushdi remains jailed without bail at the Delaware County prison.
After the hearing, defense attorney Michael Malloy said his client, who appeared to be drifting off at times, had not fallen asleep.
"He might have been meditating," Malloy told the newspaper. "He certainly wasn't falling asleep."
The boy's father, 21-year-old Abdullahi Omar of Worcester, Mass., told reporters he hopes Rushdi gets what he deserves.
"I wish there was something I could do," Omar said.