Two men were slashed on a Manhattan-bound C train Tuesday afternoon in Bedford Stuyvesant in a seemingly random attack, authorities said.

A 30-year-old man and 23-year-old man were both slashed on the left of their faces with a razor on the train near the Ralph Avenue station at about 3:50 p.m., police said. The suspect, a man in his 30s who was not immediately identified, fled but was caught four blocks away, by the intersection of Rockaway Avenue and Fulton Street.

The razor was recovered and charges were pending Tuesday.

The attack seemed to be random, police said, and the suspect did not know either of the victims.

The victims were both taken to Brookdale University Hospital and Medical Center, police said.

By Tuesday evening, commuters moved about as usual, with little remaining to remind them of the earlier violence.

Frank Rivera, 48, was making a delivery nearby when he saw several police in the area and a helicopter.

"That's good that they caught the guy but that could happen to anyone," said Rivera, from Brownsville. "You just want to get home safe and you're tired and that could happen."

Jamal Saibaan, 37, works at the deli across the street from the station. He said he was surprised to hear about the incident.

"I don't even want to take the subway tonight to get home," said Saibaan, who lives in Bay Ridge. "I don't know what I should do."