A homeless man offered libations and a toast on Tuesday to the four vagrants who were killed while sleeping in Chinatown — while other itinerants abandoned the area in fear.

The scene unfolded in the Kimlau Square park, where mourners arranged candles, flowers, fruit and other items in the corner of a large planter near the scene of Saturday’s fatal bludgeonings.

Cops said most of Chinatown’s vagrants had abandoned the area in the wake of the killings that authorities say were committed by vagrant Randy Santos — and there was only one homeless man sleeping on a bench in the square, normally a magnet for street ­people.

“A lot of them knew the victims, they’re pretty shaken up,” one ­police officer said.

A worker who was sweeping up the park also said, “They left. Afraid to be here.”

The man who toasted the victims was visibly upset as he and a pal approached and stared at the memorial around 10 a.m.

He then snatched up cash lying among the mementos and walked off with his friend toward Canal Street, cursing up a storm in apparent anger over the unprovoked slayings.

The man who grabbed the money returned about 15 minutes later, clutching a miniature bottle of vodka.

After speaking aloud in front of the memorial, he opened the bottle, poured some of the ­liquor on the ground and took a sip.

He repeated the actions, raising a toast before he drank, then poured out what remained in the bottle, which he placed amid the objects before ­storming off.

One of the few other homeless people who remained in the square Tuesday said he’s friends with the fifth victim and sole survivor of the attacks, and broke down in tears while discussing the unprovoked carnage.

“I am going to Staten Island because I want to go there and sleep, because I am afraid they will do something to me,” Daniel Guzman, who appeared to be in his 60s, said in Spanish.

Later on Tuesday evening, other mourners assembled at Kimlau Square to hold a vigil for the dead men.