NEW YORK (AP) _ A man's legs were severed after he was shoved in front of a subway train by a homeless man during the evening rush hour.

Edgar Rivera, a 46-year-old father of three, was standing on the platform at 51st Street and Lexington Avenue when Julio Perez, 43, pushed him onto the tracks, seconds before the train entered the station Wednesday evening, police said. The two did not know each other.

Surgeons were unable to reattach Rivera's legs, Bellevue Hospital spokeswoman Eleanor Hyman said. She said Rivera's condition had improved slightly overnight.

This morning, riders shook their heads at the news and some said they would be more cautious.

``I have to admit I'm hugging this pole a little tighter today,'' said Dawn Rojas, who stood with one arm firmly attached to a pole in the middle of the platform. ``It's every rider's worst nightmare.''

Agnes Torres stood with her back against the subway wall, a frequent habit. ``I see people standing up close past the yellow line and I want to yell at them, `Don't do that!' But it's really not my business, is it?''

Commuters like Lynda Warner, however, were less concerned. Standing near the edge of the platform she shrugged, ``Look, what am I going to do? I have to take the subway. My policy is: I just don't think about it.''

Witnesses said Perez had been acting strangely just before the attack, and allegedly punched a wall after a passenger asked him to move away.

Within seconds, they said, Perez pushed Rivera into the train's path. Witnesses said Rivera yelled, ``Oh my God!'' as he lost his balance and fell. Two cars of the train passed over him.

Passengers held Perez until police arrived. The suspect was arrested, questioned and charged with attempted murder.

Fire Capt. Fred Ill, one of the first rescuers on the scene, said it took three men to pull Rivera from between the cars and up to the platform.

``His eyes were aware, but I think he was really in shock,'' Ill said.

In January, Kendra Webdale was killed when she was shoved in front of a subway train. Andrew Goldstein, who said ``ghosts'' inhabit and control his body, was charged with her murder.