CHICAGO (AP) _ A judge, forced to decide the fate of a dying 12-year-old by choosing between the boy's father and mother, sided with the mother Thursday in ruling that the youngster cannot be forced to undergo further surgery.

Circuit Judge Thomas J. O'Brien, who left the bench briefly when he became choked up, gave Yisroel Soloveichik's mother authority to determine the boy's medical treatment in accordance with doctors' recommendations.

But he said the evidence was overwhelming that ''both are loving parents.''

The boy, diagnosed two years ago as having brain-stem cancer, is on a respirator and fed intravenously. He is unable to communicate or hear.

His parents had sued each other over the father's request that the boy undergo a surgical procedure to relieve pressure on the his brain by draining away fluid.

Miriam Soloveichik, the boy's mother, and doctors had argued against such a move, citing the risk of pain and infection.

''There are few winners in a case like this. This is a genuine tragedy if there ever was one,'' said Christopher Cohen, the mother's attorney. ''The only winner, if there is one, is the boy, in that he will be allowed to die in comfortable surroundings.''

Moshe Soloveichik, 39, an Orthodox rabbi, was convinced that surgery might help his son and was disappointed by the ruling, said his attorney, Howard London. He added that no decision had been made on an appeal.

Doctors at Rush Presbyterian-St. Luke's Medical Center, where Yisroel has been hospitalized since diagnosis, said that the boy probably has less than two months to live and that they could not guarantee surgery would prolong his life.

The boy' father felt surgery ''would prolong the boy's life without exposing him to any prolonged suffering,'' London said.

O'Brien's ruling specifies that life-support systems now in use are not to be withdrawn.

''Neither of the parents suggested withdrawing any existing life-support procedures. This is not what is colloquially called a 'pull-the-plug' case,'' Cohen said.

''It's a case regarding heroic measures requested against medical advice, wherein pain and suffering would result to an irreversible terminally ill patient,'' Cohen said in a telephone interview after the ruling.

The North Side couple, who have four other children and are still living together, filed lawsuits against each other last week.

The father asked the court to give him sole custody of the boy so he could approve the operation. Doctors at Rush opposed the surgery, so Soloveichik proposed having it performed at another hospital.

In her lawsuit, Mrs. Soloveichik sought to prohibit the surgery and keep the boy at Rush.

Catherine Ryan, an attorney for the hospital, called the ruling ''very thoughtful, very caring ... and correct.''