QUINCY — A pregnant woman’s pained screams could be heard in a Quincy courtroom Thursday as Judge Mark Coven watched a video that prosecutors say shows the woman being beaten by two Quincy teenagers outside a downtown post office.

After watching the video, Coven ruled that the two defendants, Tyrese D. Johnson-Nurse, 19, and David D. Russell, 18, could pose a danger to the public and ordered that they adhere to additional conditions, including wearing a GPS monitor, if released. The two had been held behind bars since their arrest Tuesday on charges of aggravated assault and battery on a pregnant woman and assault and battery.

Russell, who is also charged with assault and battery with a dangerous weapon, is expected to be released Friday with a GPS monitor. He was not required to post bail but must stay away from the woman and any witnesses and remain in his house except to go to work.

Johnson-Nurse will remain behind bars after his bail in a pending armed robbery case in Suffolk Superior Court was revoked. Both are due back in Quincy District Court on May 29.

“This is two guys involved in a very brutal incident,” Coven said from the bench. ”(Russell) was beating the hell out of this poor pregnant woman.”

Coven used a laptop to watch a video filmed by a witness that prosecutors said showed part of the attack. The video couldn’t be seen by those in the courtroom, but the woman’s screaming was audible from the computer’s speakers.

Police said the woman was walking with her boyfriend at about 6 p.m. Tuesday when she felt sick because of her pregnancy and began to throw up outside the post office at 47 Washington St. Police said Johnson-Nurse and Russell were laughing at her and spit on her.

Police said the teenagers got into the couple’s faces and began punching the woman in the head as she screamed that she was pregnant. The men also attacked the boyfriend, who stepped in to defend his girlfriend, police said.

The woman told police that Russell had kicked her in the stomach and said, “I hope he dies.”

The men took off and police arrested them at a nearby store. Police said the woman had no visible injuries and the man had a cut on his head. Both went to the hospital on their own, police said.

Assistant District Attorney Ritaclair Muse said the woman had to go back to the hospital to check on the health of the fetus.

“It’s nothing short of shocking,” Muse said while requesting the pair be held without bail. “It’s unbelievable conduct.”

Under state law, if a judge determines that a defendant charged with a violent crime would pose a danger to the public if released, the judge can require additional conditions, such as abiding by a curfew, or detain the defendant without bail for up to 120 days. If the defendant violates the conditions of the release, they can end up behind bars again.

After watching the video, Coven indicated that Russell seemed to be the most aggressive in the fight.

“If I see him again, he’ll spend 120 days without bail,” Coven said.