A Maine man pleaded guilty on Wednesday to killing his longtime girlfriend and the mother of his two children.

Authorities charged Nicholas Lovejoy of Waterville with the death of Melissa Sousa, 29, in Waterville in 2019. The 31-year-old Lovejoy agreed to a plea deal that will cap his sentence at 45 years in prison, the Kennebec Journal reported.

Police found Sousa’s body in the basement of an apartment the couple shared with their twin girls. Court documents state that Lovejoy admitted to police that he killed Sousa, but he said he did so in retaliation during a fight.

Police found the body after acting on a warrant. Sousa told police he rolled Sousa in a tarp and wrapped it in duct tape before dumping it in the basement, court records state.

Lovejoy will be sentenced in about two months.