A part of Interstate 580 was shut down on Wednesday morning as police negotiated with a gunman who had barricaded himself in a motel after firing a shot at the highway, according to the authorities.

The gunman, who was suspected of being involved in a stabbing at United Markets in San Rafael, Sunday afternoon, had fired at least one shot around 11:30 a.m., before holing himself up in a second-floor room at the Extended Stay Deluxe San Rafael at 1775 E. Francisco Blvd., police said.

The officers communicated with the gunman. "He did make statements about he has a girlfriend with him, and we believe she might be in the room with him," Margo Rohrbacher, a San Rafael police spokeswoman, said. "He did fire at least one shot out the window across the freeway."

The portion of Highway 101 southbound that connects to I-580 and all of I-580 east was closed by the California Highway Patrol, according to Officer Chris Rardin. The Richmond-San Rafael Bridge westbound at the toll plaza was also shut down by Highway patrol officers in Oakland, but it reopened in both directions soon, although police are still negotiating with the man.

Portions of Kerner and East Francisco Boulevard were also closed.

"It's a volatile situation," Rardin said. "We can't allow motorists to go through that area."