FARMINGTON — Ryan Cunningham was sentenced Tuesday to serve nine months of a three-year sentence for punching an ex-girlfriend in the nose and hitting her with a frying pan in September.

Cunningham, 28, of Farmington, pleaded guilty to a felony charge of domestic violence assault at Franklin County Superior Court.

Cunningham and the victim formerly had a relationship but were no longer involved at the time of the assault, according to court documents. The two still lived in the same building, but not as domestic partners.

Deputy District Attorney James Andrews said the assault occurred Sept. 3 when the victim went to Cunningham’s section of the building.

She then went downstairs, where Cunningham followed her, punched her in the nose and went back upstairs, Andrews said.

The woman then headed upstairs to confront Cunningham, when he hit her on the head with a frying pan, knocking her to the floor, and then hit her on the legs with a pot, according to Officer Darin Gilbert.

The victim went to a Farmington hospital, where she was treated for injuries to her arms and head, a broken nose and a mark on the lower part of her body in the shape of a frying pan, according to court documents.

On Tuesday, Judge Tammy Ham-Thompson asked Cunningham if he thought he could be found guilty if the state presented its evidence at a trial.

“Possibly,” he said.

Upon his release from jail, Cunningham will face three years of probation and must complete a certified batterer intervention program.

He also will be prohibited from having contact with the victim.

A conviction on the assault charge carries a maximum five years in prison.