Three Hayward men are scheduled to be arraigned on assault and hate crime charges in San Francisco next week for allegedly shooting a man they thought was gay with a BB gun.

The Feb. 26 incident took place at about 10 p.m. outside a Mission District bar at 16th and Guerrero streets, according to police.

The 27-year-old San Francisco man had just come out of the bar when he was shot once in the cheek by suspects in a nearby car, which then drove off, police spokesman Officer Samson Chan said.

The man was not seriously injured and called police, and while officers were interviewing him outside the bar, he spotted the same vehicle again driving by, Chan said.

Police pulled the car over and found three men inside with a “rifle-style” BB gun and a video camera, which investigators later discovered had recorded the shooting, according to Chan.

The three men, Shafiq Hashemi, 21, Sayed Bassam, 21, and Mohammad Habibzada, 24, the driver, were arrested.

According to Chan, they allegedly admitted to the crime.

“The suspects did make a confession, basically stating that they came to San Francisco to target gay people,” he said.

Prosecutors have since charged all three men with assault with a deadly weapon, hate crimes and attempted mayhem, a charge relating to the possibility of a disabling or disfiguring injury.

The men appeared in San Francisco Superior Court Thursday but arraignment and plea entry were postponed until March 12, according to the district attorney’s office. They remain out of custody after posting $50,000 bail.

Anyone who may have been a victim of a similar incident is asked to contact the Police Department’s hate crimes unit at (415) 553-1133.