Las Vegas madman Stephen Paddock set up a camera inside his hotel room during his deadly shooting rampage — and other surveillance in the hallway to alert him as cops closed in on him, officials said.

The shooter had placed a camera by the peephole in his room at the Mandalay Bay Casino, according to Las Vegas Metropolitan Police Department Undersheriff Kevin McMahill. Earlier, ABC News had reported he had a camera in his room to record himself.

Paddock also wired up two cameras in the hallway outside his room, McMahill said.

Police officials said the cameras had been meant to help Paddock watch out for cops, though it is not clear how he might have been monitoring them.

Paddock killed 59 people and injured more than 500 in the worst mass shooting in US history.