A homeless maniac bludgeoned four other vagrants to death as they slept on the sidewalks of Chinatown early Saturday — bashing in their skulls one by one with a scavenged metal bar during a senseless predawn murder spree.

Rodriguez “Randy” Santos is just 24, but already had what cops call a history of violent, random attacks when he allegedly approached his first victims, two men sprawled asleep side by side on cardboard bedding at Bowery and Doyers Street just before 2 a.m.

“They were sleeping. They never saw it coming,” one shocked police source told The Post.

After smashing the pair in the heads with the 15-pound, 3-foot-long piece of metal, Santos left the two men for dead and stalked for more victims, police said.

Around the corner on East Broadway, he allegedly attacked three more sleeping men, hitting them, too, in their heads.

“He just walked up to them and pummeled them,” said the source.

At least one of the attacks was captured on surveillance video, and additional video from moments after the final attacks shows Santos alertly looking up and down the sidewalk as he headed north with his yard-length weapon, the source said.

“The way he was walking, it looked like he was looking for more victims,” the source said.

Police, alerted by a 911 call, caught up with Santos soon afterward at Mulberry and Canal streets.

He still held the heavy metal bar, slung over his shoulder.

“I found it,” the source said of his alleged weapon, streaked with blood.

In all, police said Santos had struck five homeless men — one of whom was 83 — as they slept on the otherwise desolate sidewalks of Chinatown on the first chilly night of autumn.

Only one — a 49-year-old man who’d been struck on the Bowery — survived.

“Randy did it,” that man managed to tell arriving medics, a second source told The Post.

The victim was rushed to NewYork-Presbyterian/Weill Cornell Medical Center in critical condition.

Police hoped to question him as soon as his health allowed, Deputy Chief Michael Baldassano, commanding officer of Detective Borough Manhattan South, told reporters at a press conference.

None of the victims’ identities were released by early evening on Saturday.

Santos was being held Saturday night in the Fifth Precinct pending his arraignment; he faces multiple murder and assault charges.

He had been acting “not 100% there” in his holding cell, a source said — including exposing himself.

“He’s doing things that would get him arrested if he was doing them in the subway,” the source noted.

A native of the Dominican Republic, Santos lived with family in the Bronx as a teenager but in recent years began showing up at homeless shelters — and on police blotters.

He has 14 past arrests, four of them from the past year, the source said.

“That man should not have been on the streets,” noted one law enforcement source.

Santos’ Facebook page bio hinted at menace: “I’m a calm guy,” it reads in Spanish. But “I don’t play games.”

The most unhinged incident on his rap sheet is a November 2018 attack in which Santos allegedly leaped over a desk at an SRO on West 35th Street in Midtown, grabbing a man by the neck and biting down on his chest, a high-ranking law enforcement source said.

That case has since been sealed, and its disposition is unclear.

That same month, Santos allegedly randomly slugged a stranger on a Q train heading north near Canal Street.

“We need to stop it!” Santos allegedly told the stranger.

When the stranger asked him what he was talking about, Santos allegedly hauled off and slugged him in the right eye.

His most recent bust was on May 13, for allegedly striking another homeless man in the shelter where police sources say he lived most recently, on Clarkson Avenue in Brownsville.

His weapon was alleged to be a metal pipe. The disposition of that arrest was also unclear.

In March, he allegedly groped a 19-year-old woman in Jamaica, Queens.

In February, he was busted for allegedly shoplifting.

He has sealed assault and resisting-arrest cases from late 2017 and early 2018, police sources said.

“Oh he’s crazy — he’s a crackhead,” a homeless man at the Clarkson Avenue shelter said Saturday.

“He got violent with me a long time ago,” continued the man, who gave his name as Abraham.

“He’s very violent. I don’t like him. He’s gone after people in here.”

Pressed for details, Abraham would only say that Santos was prone to picking fights: “He came up to me. He tried me but I didn’t want to do anything.”

When shown his photograph, multiple men at the shelter said they know Santos and claimed he had serious problems with alcohol and crack.

“He had issues,” said a resident named Alexis.

“You got dudes in here, they got mental issues and they don’t give them the treatment they’re supposed to. As long as they get a check they don’t care what you do.”

Santos appears to have been in and out of homeless shelters for the past two years.

“He was off. He had mental issues, anger problems,” said a homeless man from the Bowery Mission, where longtime residents said Santos stayed in 2017 and continued to visit for the free food.

“He just had that crazy look about him. You could feel it,” said the man.

As for the victims, law enforcement sources described them as non-violent and known to frequent the Chinatown area.

“He was an old man,” Andrew Harris, 28, who is also homeless, said of the oldest of the victims.

“I’ve known him for two years. This morning there was nothing but blood there. He was an old man, stayed to himself. I feel very bad.”

The victims possessed little, but they were loved, their bereft friends said Saturday.

“I was on the bench with him last night,” said Simba Bossir, 59, of one of the dead.

Bossir said he sat with the victim on one of the benches of Kimlau Square, which is presided over by a statue of Lin Zexu, a Qing dynasty scholar.

“I talked to him last night,” shortly before he died, Bossir said.

They shared a friendly chat and some beer, he said. “He was a little tipsy,” Bossir remembered.

“This morning I came back, they told me he was killed,” he said, breaking into sobs. “He was my friend. It hurts.”

Additional reporting by Ruth Weissmann, Khristina Narizhnaya, Olivia Bensimon, Kevin Fasickand and Ben Cohn