A man standing near a white van approached the girl in the 4100 block of Sonia Street, near Mines Road, at around 4 p.m., Livermore police said.
The man asked if he could see her dog and gripped her shoulder as she attempted to walk by, police said.
She was able to escape by striking the suspect, police said. The girl was not injured in the confrontation.
The suspect was described as a white man around 30-40 years old, 5 feet 11 inches tall and weighing about 200 pounds. He was wearing a black beanie, a brown sweatshirt, black sunglasses and blue jeans.
Anyone who sees someone who matches the description of the suspect is asked to contact Livermore police Lt. Matt Sarsfield at (925) 371-4730.