Brittany Mae Smith has since been in touch with her family in Virginia, while Jeffrey Scot Easley, 32, was in police custody in San Francisco, Roanoke County Police Chief Ray Lavinder said at a news conference.
The two hadn't been seen since Dec. 3, when they were captured on store surveillance video at a Walmart in Salem, about five miles from Roanoke.
The girl's mother and Easley's girlfriend, Tina Smith, was found dead on Monday their home in southwestern Virginia. The cause of death has not been released but police consider it a homicide.
Police have refused to say whether they consider Easley a suspect in the mother's death, but they said Friday that the investigation of the slaying would ramp up now that the search for the girl is over.Lavinder said Brittany and Easley were in a retail store around 3 p.m. in San Francisco when someone in the store recognized the pair from reports on their disappearance and called police. Easley did not resist arrest.
Asked if Easley forced Brittany on the cross-country trip, Lavinder said he didn't know.
"We're just getting bits and pieces of the facts right now," he said.
The girl was aware that her mother had been found dead. She had no signs of physical injury.
Lavinder did not know if Easley had any connections to the San Francisco area or how the pair traveled the 2,320 miles to get there. Roanoke authorities planned to travel to California as soon as possible.
Brittany's disappearance had generated more than 700 tips to Roanoke County police, who earlier Friday said they were deeply concerned after finding no trace of the girl after days of searching.
Lavinder said he had a "tremendous sense of relief" that Brittany had been found.
After learning that her granddaughter was safe, Liz Dyer told The Roanoke Times: "We're so glad. We're bouncing off the walls."