A Revere police officer accused of beating his girlfriend's 5-year-old child has resigned.

Marcos Garcia, 32, of Saugus, is charged with assault and battery with a dangerous weapon, and assault and battery on a child causing injury in the Jan. 12 beating of his girlfriend’s young son.

Garcia pleaded not guilty to the charges and was released on $5,000 bail.

RELATED: Revere cop accused of striking 5-year-old with belt

The girlfriend, Angela Halcovich, also a Revere police officer, allowed the beating to continue, according to Suffolk County Assistant District Attorney Alissa Goldhaber.

Halcovich was arraigned in Chelsea District Court on two counts of aggravated assault and battery with a dangerous weapon. She was also charged with two counts of assault and battery on a child under the theory of wantonly or recklessly allowing another person to commit assault and battery on a child.

She was held on $2,500 bail and ordered not to have unsupervised contact with the victim. She remains a Revere police officer.

According to police, Garcia stripped, handcuffed and whipped the boy when he refused to eat dinner.

Garcia and Halcovich were having a two-year affair, WBZ reported. Garcia is married to another woman, with whom he has one child.

Halcovich alleges that Garcia has been “mentally abusive and controlling” toward her and her two sons and said he takes steroids, according to police.

Garcia was an award-winning officer who received an award for heroism last year for removing two victims from a car crash.