The father of a Gaithersburg boy who disappeared this year was arrested yesterday when he showed up at Howard County Circuit Court to ask for custody of the child.

After shackles had been placed on his ankles, Cory Wharton, 28, went ahead with his testimony, in the latest in a tangled series of events surrounding the child and his parents. It began when the boy, Matthew Burns, 4, disappeared in January after being at day care in Montgomery County.

Matthew's mother, Jennifer A. Burns, 24, was found dead in May at the bottom of a cliff in Cascade, Md., and officials said her death appeared to be a suicide. Burns's mother has said she had become depressed about the boy's disappearance.

The boy's disappearance was highlighted on the Web site of the National Center for Missing and Exploited Children, and he eventually was found in St. Petersburg, Fla. Wharton's mother, Cynthia Sargent, was charged with kidnapping; Wharton has been charged in the boy's disappearance and with assaulting the boy's mother.

Wharton had been described as a fugitive until he unexpectedly showed up at the courthouse yesterday to seek custody.

"I love him more than anything," Wharton said at the hearing.

Wharton and his mother allegedly took the boy from his Kensington day-care facility Jan. 30. Wharton also allegedly assaulted the boy's mother that day.

Wharton has been wanted as a fugitive since February, when he was detained in Delaware but failed to appear in court after he was released on bond, authorities said.

He was being held in the Howard County jail last night, authorities said. He is expected to be moved during the weekend to Montgomery County, where the specific charges against him are second-degree assault and detaining a child out of state for more than 48 hours, they said.

Sargent told Pinellas County, Fla., law enforcement officials last week that she fled to Florida with the boy because she feared that his mother was mentally unstable and that the child was in danger, a spokeswoman for the Pinellas County Sheriff's Department said. Montgomery police said she will be extradited to Maryland within two weeks.

The boy is in the custody of Florida social service authorities, police said yesterday.

In yesterday's hearing before Howard Circuit Court Judge Lenore R. Gelfman, Wharton and Matthew's maternal grandmother, Mary Middledorf, each sought custody. After nearly five hours of testimony, Gelfman granted temporary custody to Middledorf and ordered Florida authorities to turn Matthew over to his grandmother, who is to pick the boy up in Florida.

Wharton has served five years' probation in Delaware for possession of marijuana and also has been convicted of robbery, he said in court yesterday.

"Mr. Wharton . . . has a substantial criminal background," said Jonathan D. Isaacs, Middledorf's attorney. "I'm not sure he knows where he lives. Certainly nobody else who has testified does."

Howard Miliman, an attorney for Wharton, called the boy's abduction an act of heroism.

"You can look at [Sargent] as somebody who didn't obey a court order, or as somebody who saved a child's life," Miliman said.

A statement signed by a Howard County social worker and filed in Howard Circuit Court states that Jennifer Burns told her therapist in July 2000 -- one month after the boy's birth -- that she had "placed her baby facedown on a pillow and 'said a prayer that the child would die and go to heaven.' "

The document also states that in August 2000, Burns "reported to her therapist that she was suicidal" and had a plan that involved stepping in front of a car while holding her son.

Family members and co-workers said at the courthouse that Burns had received effective psychiatric treatment and was improving, consistently taking her medication.

"What killed her is their taking her child," said Jennifer Burns's aunt, Kathy Faber, referring to Wharton and Sargent. "She would never, ever, ever harm her child."

Staff writer Martin Weil contributed to this report.