A man was arrested after allegedly trying to follow a woman home in Berkeley on Saturday, the police department said.

Police said a female bartender was driving home from her shift in San Francisco early Saturday morning when she noticed a vehicle that might have been following her. To confirm her suspicions, the woman got off the freeway in Berkeley to see if the vehicle would also follow her, according to authorities.

When it did, officials said the woman called for help.

Berkeley police said officers directed the woman to drive to the police station, where officers were waiting to stop the suspicious vehicle.

When officers contacted the driver, they spotted a loaded handgun in the vehicle and took him into custody, according to officials. Authorities reported officers also found crack, cocaine, several crack pipes, a flashlight taser, gloves and a BB gun in his vehicle.

Additionally, officials said the handgun was stolen from Richmond.

The suspect, a 36-year-old man from San Francisco, was arrested on suspicion of several weapon and drug-related offenses, according to the police department.