A hammer-wielding man was still on the loose Tuesday, a day after he attacked three people throughout the city, as police continued to investigate a fourth attack near Madison Square Park.

In the first attack, a man in his 30s was hit with the hammer near Herald Square just after 1 p.m. on Monday, police said.

A few hours later the suspect approached a 28-year-old woman sitting on a bench in Union Square. He pulled the hammer from his black backpack and struck her in the head at about 7:30 p.m.

He then walked north and about 10 minutes later sneaked up behind a 33-year-old woman. He swung the hammer, hitting her in the back of the head, police said.

Both women were taken to Lenox Hill Hospital where they were treated and released.

By Tuesday, police were also investigating a fourth attack on Madison Avenue, between East 25th and 26th streets, to see if it was connected. In that incident a 34-year-old woman was struck in the head, police said.