OAKLAND — A 28-year-old Hayward man survived and his 6-year-old son was uninjured early Tuesday after gunfire came at a parked pickup truck, police said.

The bullets flew about midnight in the 100 block of 4th Street in Jack London Square.

According to police, a driver and passenger who wore masks pulled up alongside the parked truck and started shooting with a rifle. The man was in the driver’s seat when the shooting started, while the 6-year-old was sitting next to him, police said.

At least one of the shots hit the man, who then drove himself to a hospital, police said. They added that he remained there Tuesday morning in critical but stable condition.

None of the shots hit his son. Police said he was OK physically.

Police did not have any detailed descriptions of the two suspects and did not have a motive for the gunfire. They urged anyone with information to contact police at 510-238-3426.

Staff writer Harry Harris contributed to this story.