The boy was at the Encina Grande Shopping Center at Ygnacio Valley and Oak Grove roads when a dark blue, mid-size Chevrolet SUV pulled up to him.
The driver told the boy something similar to, "You don't remember me, but I know your mother and she wanted me to pick you up," police said.
The boy ran away without saying anything to the man and contacted a security guard working at the shopping center, police said.
"He's a smart kid. He did the right thing," Walnut Creek police Lt. Mark Perlite said.
The guard looked for the vehicle, but didn't find it.
The boy went home and the incident was reported to police later that evening.
The driver was described as a white man in his late 30s or 40s. He was bald and had green eyes and a goatee. He was about 5 feet 10 inches tall, heavy-set and was wearing a white T-shirt and dark pants.
There was a passenger in the car as well, who was described only as a white man in his 30s with short blond hair.
Police are working on a sketch of the suspects, which they hope to release later today.
Anyone with information about the case is asked to call Walnut Creek police at (925) 943-5844.