CHANDLER, Ariz. — The assailant slipped out of a park around noon one day in October, zeroing in on his target, which was idling at a nearby intersection — a self-driving van operated by Waymo, the driverless-car company spun out of Google.

He carried out his attack with an unidentified sharp object, swiftly slashing one of the tires. The suspect, identified as a white man in his 20s, then melted into the neighborhood on foot.

The slashing was one of nearly two dozen attacks on driverless vehicles over the past two years in Chandler, a city near Phoenix where Waymo started testing its vans in 2017. In ways large and small, the city has had an early look at public misgivings over the rise of artificial intelligence, with city officials hearing complaints about everything from safety to possible job losses.

Some people have pelted Waymo vans with rocks, according to police reports. Others have repeatedly tried to run the vehicles off the road. One woman screamed at one of the vans, telling it to get out of her suburban neighborhood. A man pulled up alongside a Waymo vehicle and threatened the employee riding inside with a piece of PVC pipe.