Ramon Rivera, 51, spent hours sleeping in police custody after he was nabbed in Monday’s bloody, broad-daylight stabbing spree, sources familiar with his arrest said.

When he awoke, he waived his Miranda rights and allegedly — and calmly — gave a full confession, sources said.

Rivera, a homeless man with mental health problems and an extensive criminal record, according to sources, was awaiting arraignment Tuesday on three counts of first-degree serial murder.

The “unprovoked” random attacks unfolded over the course of two hours, beginning with the stabbing of a 36-year-old male construction worker waiting to be picked up from work in Chelsea, police said.

The deranged stabber — Rivera, police said — then trekked across Manhattan to the East River waterline, where he fatally knifed a 67-year-old man who was fishing, cops said.

A third victim — Wilma Augustin, 36 — was stabbed near the United Nations building, police said. She was rushed to a nearby hospital, but succumbed to her injuries hours later, according to cops.

Advertisement