Police took David Montiel Cruz, 24, into custody in a pre-dawn raid at the home of a friend. He was arrested less than a mile from where he allegedly kidnapped her after brutally beating her mother and brother.
The girl turned up at a convenience store several cities away, shaken but safe, and helped lead police to her alleged abductor.
"The motive appears to be a sexual abduction, because we don't see any other motive at this point," Assistant Chief Thomas Wheatley told The Associated Press on Monday. Police said they have physical evidence of a sexual assault.
Cruz was being booked on suspicion of kidnapping, burglary, robbery, assault with a deadly weapon and sexual assault, Wheatley said. He is scheduled to be arraigned Wednesday.
The girl was said to be resting Monday after her ordeal.
Police conducted an extensive search over the weekend for the intruder after he kidnapped the girl as she returned home alone from school Friday. The captor savagely beat her mother and brother after they returned home and confronted him, then sped off with the terrified girl in the back seat of his car.
Police said Monday they believe Cruz knew of the fourth-grade girl through one of her former schoolmates, though neither the girl nor her family knew him.
A SWAT team raided a San Jose home where he was staying with a friend and found him hiding in the attic, Deputy Chief Rob Davis said. He tried to fight off officers and was briefly hospitalized after a police dog bit him.
Cruz resembled a police sketch of the suspect and had injuries consistent with what police expected from the struggle he had with the girl's mother, Chief William Lansdowne said.
"We're very confident this is the right person," Lansdowne said.
"We have been talking to her since she was found," Lansdowne told the CBS News Early Show. "She's in very good spirits and good health and has just a tremendous memory and is helping us very much in this investigation."
The girl's mother, her face still swollen and bruised from Friday's attack, thanked authorities, the media and her neighbors before she began to choke back tears.
"I want to tell all mothers not to let your kids walk alone on the street, no matter how secure it is," the girl's mother said in Spanish. "Because when you feel you lose a child, I think it is like the feeling of dying."
The girl's ordeal ended Sunday night, when she suddenly appeared at the Eastside Market in East Palo Alto, about 30 miles north of her home. "She was crying and scared," said Isa Yasin, the owner of the shop.
The girl was probably dropped off by her captor, who might have been frightened by the attention the case received, Davis said.
The kidnapper told the girl not to call police, so she first tried to call her mother, though she was too shaken to dial the number. Yasin realized who the girl was after talking briefly with her and called police.
Reunited with her family, she was in good spirits, and because she remained alert during the ordeal, she provided investigators with information leading to the arrest, Lansdowne said.
Davis said police believed all along the abduction was not a random crime: not only did the attacker wait for the girl to return home, he twice told her mother "you know what I want" as he beat her before screeching off.
In the girl's neighborhood, residents poured into the streets to hug and celebrate as news of her return spread. Some parents vowed to be more vigilant.
"I'm not going to leave the kids out of sight at all. I may run into the house to get something, but I'm going be on them constantly," said Meredith Willis.
Much of the crime was captured in a grainy videotape produced by surveillance cameras mounted on a neighbor's home.
The tape presented a step-by-step account of the crime, from the kidnapper's wait in his car outside her house to the audible screams of the mother as the girl was taken away.
CBS News Correspondent John Blackstone talked with Bobby Ozier, the technician who installed the surveillance system that caught the suspect on tape, and also godson to the home's occupants the Kamfolts. Ozier said the system includes cameras that point in four directions and records in a continuous loop on a 24-hour tape.
Though the abducted girl's name was initially widely reported in the media, it is CBS policy to omit the names of victims of sex offenses.