A ConEd worker went on a bloody rampage Monday, stabbing his former girlfriend on the Upper East Side before using a hatchet to attack two people inside the company's Union Square headquarters.

The stabbing spree started about 2:30 p.m. when the man attacked his 36-year-old ex – with whom he has a child – inside the stairwell of her workplace, the Robert Sterling Clark Foundation building  on East 64th St., authorities said. 

The unidentified woman was reportedly stabbed seven times in the stairwell. She suffered from stab wounds to her stomach and lower back, police said.  

The woman was transported to New York Presbyterian Hospital in a stable, but serious condition. The suspect, described as a black male in his 40's, fled on foot wearing a bright red shirt.

Shortly afterward, he turned up at the Con Edison office near Union Square armed with knives and a hatchet, police said. He attacked two people on the 10th floor before trying to flee, but security stopped him from leaving through the glassed protectors at the entrance. 

The victims in the second attack were being treated for injuries that were not believed to be life threatening. The man was under psych evaluation at Bellevue.