Around 8:10 p.m., BART police received reports of a man on the ground at the Embarcadero station and a fight occurring on the platform and possibly on a train, Lt. John Conneely said.
Based on a preliminary investigation, police believe a group of four men were responsible for assaulting three other men.
One of the suspects was armed with a handgun, which was used to pistol-whip the three victims, Conneely said.
San Francisco police officers responding to the incident spotted a group of four men fleeing from the Embarcadero station believed to be responsible for the attack and detained them.
The case is being investigated as an assault with a deadly weapon, Conneely said.
The incident caused delays of up to 30 minutes between the Embarcadero and West Oakland BART stations as thousands of people made their way home following the San Francisco Pride celebration.