A Long Island panhandler was arrested Sunday after allegedly slashing a man who had just given him money, tossing a brick through a store window and showing up at the same hospital where his victim was being treated.

The suspect approached the man on Meacham Avenue near the Hempstead Turnpike in Elmont about 3 a.m. and asked the man repeatedly for money, Nassau County police say. The victim gave the suspect $1, but the panhandler asked for more when he saw extra cash in the victim’s wallet.

When the victim refused, police say the panhandler pulled out a knife and stabbed and slashed the man in the face, neck, chest and hands. Then, to stop the attack, the victim grabbed a pipe off the ground and hit the panhandler.

After the stabbing, the suspect ran away and allegedly tossed a brick through the window of a nearby gas station. Then, police say, he went to the hospital.

The stabbing victim had just been driven to the same hospital. The victim, who had serious lacerations and stab wounds, saw the panhandler there and pointed him out.

The panhandler was arrested at the hospital and is charged with first-degree assault, criminal possession of a weapon, criminal mischief and two counts of attempted robbery.