A Huntington Station man with a history of violent crimes pleaded not guilty Tuesday to an indictment charging him with breaking into a Cold Spring Harbor home on Thanksgiving night and beating an 85-year-old visitor.

State Supreme Court Justice William Condon in Riverhead ordered Jeffrey Rice, 45, held on bail of $1 million cash or $2 million bond.

Rice’s attorney, Ed Vitale of the Legal Aid Society, entered not guilty pleas to charges of first-degree burglary, second-degree assault and other crimes. Rice faces 25 years in prison if convicted of just the burglary charge.

The apparently random attack began at about 11 p.m. when Rice let himself in using an unlocked door at the home on Fox Hunt Lane, said Assistant District Attorney Maria Troulakis.

Rice took a knife from the kitchen and went upstairs to a 7-year-old girl’s room, where the homeowner’s visiting aunt was also sleeping on a mattress, Troulakis said. Rice brandished the knife at the aunt and then punched her, Troulakis said.

The homeowners came into the hall and Rice confronted them, forcing them into their bedroom, Troulakis said. But she said the husband, 40, had a baseball bat there, and he began clobbering Rice with it while his wife called 911.

advertisement | advertise on newsday

The husband chased the intruder out of the house and held him with the bat until police arrived.

Troulakis told Condon that Rice had an extensive and violent criminal history, including convictions for attempted robbery and grand larceny.

But Vitale said his client also has a long history of psychiatric hospitalizations. He asked Condon to have Rice examined for a possible psychiatric defense, and Condon agreed.

Troulakis declined to comment on why Rice chose this particular house. Rice did not know the homeowners.

“He’s not thinking normally,” Vitale said after court. “He said he was hearing voices.”