The boyfriend of a slain 5-year-old New Hampshire boy's mother plans to plead guilty to manslaughter, according to a court document.

Joseph Stapf, 31, was originally charged with child endangerment and witness tampering in connection with Elijah Lewis' disappearance. He also plans to plead guilty to second-degree assault, falsifying physical evidence, and witness tampering, according to a plea notice filed Friday in court.

A plea-and-sentencing hearing for Stapf was scheduled for Jan. 4, 2023. The fully negotiated plea carries a sentence of 22 to 45 years in prison, according to the document filed by Stapf's lawyer.

ELIJAH LEWIS REMAINS FOUND IN MASSACHUSETTS: AUTHORITIES DISCOVER 5-YEAR-OLD'S BODY 'BURIED IN THE GROUND'

Elijah's mother, Danielle Dauphinais, 36, has pleaded not guilty to murder charges.

Lewis was missing and later found dead in Abington, Massachusetts, last October. An autopsy showed he suffered facial and scalp injuries, acute fentanyl intoxication, malnourishment and pressure ulcers.

Joseph Stapf

Joseph Stapf, 31, pictured above at the Merrimack Police Department, in Merrimack, N.H., on Sept. 2, 2022, is set to enter a guilty manslaughter plea in the case of Elijah Lewis' death. (Photo/Merrimack Police Department via AP)

When Lewis was still missing, Stapf and Dauphinais were arrested in New York that month on charges of witness tampering and child endangerment. Days after their arrest, Elijah's remains were found. Both Dauphinais and Stapf remain in jail.

Dauphinais was indicted earlier this year on one count of first-degree murder alleging that she purposely caused her son’s death, one count of second-degree murder alleging she acted recklessly in causing his death, and three counts of witness tampering. She pleaded not guilty. Some motions have been filed in her case, and a hearing is scheduled for Oct. 26.

NH MAN STABBED TO DEATH ON MANCHESTER TRAIL IDENTIFIED BY POLICE

Dauphinais is accused of killing her son sometime between Sept. 27, 2020, and Sept. 24, 2021. She also is accused of telling two people to lie and say the boy was with them in October and telling a third not to talk to investigators.

Arrest records have been sealed and lawyers are under an order keeping the information confidential.

"Counsel cannot discuss the facts of the case in open court with the Court without breaking the Court’s confidentiality order," according to a document from one of Stapf's lawyers requesting a status conference before the judge in August.