After being held captive for nearly a year, an emaciated and shackled 17-year-old boy climbed out a window in the home of his captors and walked into a nearby gym in search of help, police said.

Authorities were still investigating the boy's alleged imprisonment and abuse by a California couple, but details of his escape were becoming clearer Wednesday, police said.

Law enforcement officers also were trying to determine how the aunt and one-time guardian of the teen knew the couple accused of holding him against his will for nearly a year.

Caren Ramirez was arrested Tuesday in Berkeley, a day after the boy walked into a gym and begged managers to hide him. He was covered in soot, had a chain on his foot and was wearing only boxer briefs.

Police arrested a couple who lived near the gym in Tracy and booked them on suspicion of torture, kidnapping and child abuse. Tracy is about 60 miles east of San Francisco.

Ramirez, 43, had been the teen's guardian after child-welfare officials took him from his abusive father three or four years ago, police said. Ramirez herself was later arrested for allegedly abusing the boy, and he was placed in a Sacramento foster home, which he fled in late 2007, police said.

Since then, the boy's whereabouts were unknown until Monday, when he entered the fitness center.

Police had said there were conflicting reports about how the boy ended up at the gym. The boy told investigators he had been chained inside a sport utility vehicle that pulled up to the home. After going inside the house, he climbed through a rear window and jumped the fence between the backyard and a fitness center, the boy reported.

"He found his opportunity and he took it. It's basically luck that this all occurred," Tracy police spokesman Matt Robinson said.

Kelly Layne Lau, 30, and Michael Schumacher, 34, were arrested earlier Tuesday and were jailed in lieu of bail set at nearly $1.2 million each. They were set to appear in court Thursday. Authorities said neither they nor Ramirez had attorneys.

Lau and Schumacher's four young children, two of whom were home when police arrived, were taken into protective custody, authorities said.

Gym manager Chuck Ellis said the teen was scared someone was going to come after him and asked to be hidden.

The boy said he had been held captive for nearly a year, said Ellis, adding that he looked as if he was only 10 to 12 years old.

Authorities would not say whether the boy was chained regularly or where he may have been held in the home. They said they haven't determined how often he was allegedly beaten or tortured but that he appeared at the gym with cuts, bruises and burns across his body.

According to neighbors, the couple seemed to lead lives that revolved around their kids. On her MySpace Web page, Lau describes herself as a stay-at-home mom, Girl Scout troop leader and says her husband "is my best friend and a wonderful father." She posted many photos of her family, friends and pets.