ROCKLAND, Maine — A judge agreed Wednesday, over the objections of the prosecution, to allow a Rockland man to be free on bail on charges of aggravated assault and endangering the welfare of a child.

A sheriff has called it “one of the worst” domestic violence cases she has seen.

Judge Susan Sparaco agreed to the defense request to lower the bail for 33-year-old Douglas Merrifield from $35,000 cash to $35,000 unsecured. He was released from jail immediately after the hearing.

Sparaco said sometimes it feels like bail is used as punishment before trial, pointing out that people are presumed innocent unless they are convicted. She said she was persuaded by the arguments of Merrifield’s attorney, Andre Maciag of Brunswick, that Merrifield was not a threat to the community or the child.

The judge said she knows the public questions unsecured bail but that in this case it was appropriate. She noted that Merrifield has no criminal record and is not a flight risk. Two rows of the courtroom at Wednesday afternoon’s hearing in Knox County Unified Court were filled with relatives of Merrifield. He will live with his mother and sister upon his release.

Maciag said that unsecured bail was appropriate in this case, citing the $50,000 unsecured bail granted for Lincoln County Sheriff’s Office Deputy Kenneth L. Hatch III, who is accused of sexually assaulting three young girls and providing one of them drugs.

The defense attorney contended that the charges against Hatch were more serious yet bail was unsecured.

Maciag said his client’s No. 1 goal is to reunite with his son, who is now in the custody of the Maine Department of Health and Human Services. Maciag said this was an isolated case that occurred behind closed doors and there was no risk to the public.

Assistant District Attorney Jeffrey Baroody lobbied strongly for bail to remain at the $35,000 cash. The prosecutor said nothing had changed since Justice William Stokes set bail last month.

Baroody said a video taken of the incident shows 10 minutes of Merrifield torturing his son by attempting to strangle him six times, bending his leg back until the 12-year-old boy cries out in pain, and punching the child repeatedly and kneeing him in the groin. In one instance, the boy is allegedly seen convulsing while Merrifield applies a headlock to the child.

The video was taken by a home surveillance camera.

Knox County Sheriff Donna Dennison said after Merrifield’s arrest on July 6 that it was one of the worst domestic violence assaults she has seen. Detective Dwight Burtis investigated the case and arrested Merrifield.

Merrifield worked for the county jail as a corrections officer for a few years before being dismissed by the county in 2009.