The leader of a small polygamous religious sect has pleaded guilty to two counts of first-degree murder for the 2010 shooting deaths of a former District woman and a 4-year-old boy who had been living in a group house in Durham, N.C.

Peter Moses, 28, avoided the death penalty by entering the plea and agreeing to cooperate with prosecutors in the remaining cases against six other defendants in the deaths, said A. Leon Stanback, acting District Attorney for Durham County.

If Moses cooperates, he will face two consecutive life sentences, Stanback said Tuesday night in an interview.

Moses shot Jadon Higganbothan, 4, after he became convinced that the toddler was gay after the child struck another boy on the rear end, said Stanback.

Higganbothan’s mother is among the remaining defendants in the case.

Antoinetta Yvonne McKoy, 27, formerly of Northwest, was last seen alive in December 2010. She was believed to have been beaten by other sect members and then shot in the head weeks later as she attempted to break away from the group house, according to police affidavits filed in the case.

She and Moses met as students at Dunbar High School, her mother, Yvonne McKoy, told The Post last year.

Her daughter and Moses were in the District in early December 2010 when Antoinetta McKoy announced she was moving to North Carolina with Moses, her mother said. Her daughter stopped answering calls and did not return for holidays or family events, Yvonne McKoy said.

The bodies of Higganbothan — last seen alive in October — and McKoy were discovered in separate shallow graves in June 2011 in the back yard of a home in Durham where a relative of Moses once lived, Durham police said in an affidavit for a search warrant.

Moses had called himself a leader of “Black Hebrew Israelites.”

Read more: The Post’s crime coverage