A man with a machete slashed someone who was coming out of a subway station before climbing to a building's rooftop and hurling firebombs at cars, setting one ablaze, police said.

The 21-year-old attacker set upon a 45-year-old man Tuesday night at a Queens subway station exit, police said.

The victim, who fended off his attacker with an umbrella, suffered cuts to his head, police said. He was in stable condition at a hospital.

The attacker dropped the machete and fled inside a nearby two-story building, where he went to the roof and started smoking cigarettes before setting liquid-filled containers on fire and hurling them into the street, witnesses said.

He threw at least four explosive devices, one of which struck a livery cab and set it on fire, police said. No one was injured.

Police evacuated nearby homes in the Richmond Hill neighborhood and sealed off the block during a one-hour standoff with the man. Officers swarmed the area on foot while a police helicopter hovered over the man.

Officer Robert Zajac said the ordeal ended when he told the man, "It's time to come down now," and the man complied.

The man, whose identity wasn't released, was undergoing psychiatric evaluation at a hospital on Tuesday night, police said. He hadn't been charged with any crime.

Neighbors said they were scared for their lives while the man was chucking firebombs into the street. They said they didn't know the man well but he was always quiet and hadn't caused problems before.

Click here for more on this story from MyFOXNY.com.