An Osaka court detained a man for three weeks under the law on human protection after he failed to have his son appear at a hearing in a legal dispute with his wife over the child, sources said.

The man in his 20s who is a resident of Osaka Prefecture was released Thursday after being ordered to hand over their son, 4, to his wife.

The law stipulates that courts can detain those who fail to comply with orders to attend hearings under the law until they do so. The law, however, does not have a clause on a specific period for such detentions.

"This is problematic in light of the Constitution, and the law has to be revised," Ado Matsumoto, the man's attorney, said.

The man's wife left their home with their son last summer without telling her husband. Later, the man met with their son but did not later return the child to his wife, according to informed sources.

In response, the wife filed a petition with the Osaka Family Court, and the court ordered the husband last December to hand over their son to his wife. As the husband failed to obey the order, the wife filed a complaint under the human protection law.

In April, the Osaka District Court ordered the man to have their son appear at a hearing, but the man failed to bring him on all three designated dates for reasons such as the child being taken to a hospital due to an illness.

On June 20, the third designated date, the court detained the man at the hospital where their son was. The man filed a petition to cancel the detention twice, but both requests were turned down.

After the release, the man said, "I could not sleep well as I was worried about my son and did not know when I would be released."

The news agency asked the wife's attorney for comment but has not received a response.

Family law expert Chie Sato, a professor at Kyoto Prefectural University, said it is rare for a person to be detained under the human protection law.

"It is questionable whether such a long detention is necessary," Sato said.