When his girlfriend said no to sex, Brandon Hampson flew into a rage and beat her, a Nassau County prosecutor yesterday told a jury in a small Hempstead courtroom.

But the attack was caused by Mr. Hampson’s withdrawal from the prescription antidepressant Zoloft, his attorney told jurors.