When a wall of flames chewed through a Goose Creek apartment building last May, most of the second-story unit where the blaze started collapsed and went crashing down onto the ground floor below.

Unfortunately for two men who had been cooking methamphetamine in that apartment, the fire spared enough remnants of their illegal operation to put them in prison for a long time.

Gerald McCabe, 34, and Shonni Abernathy, 40, pleaded guilty in federal court Monday to making meth in the 16-unit building at Pine Harbour Apartments that burned on May 31, killing three people. Among the dead were Abernathy’s 19-year-old daughter and a 4-year-old cousin she was baby-sitting.

Both men pleaded guilty to two of the charges in the original three-count indictment: one count of conspiring to make more than 50 grams — or almost 2 ounces — of meth and one count of making meth. In return, they aren’t expected to face a third count of creating a substantial risk of harm to human life while manufacturing meth.

Both men will be sentenced at a later date.

The fire started around noon on a sunny spring day in an apartment where Abernathy and his family lived on Harbour Lake Drive. McCabe was staying there as well, and the two ex-cons had been making meth the morning of the fire, authorities said.

Some neighbors had seen smoke waft from the apartment on occasion. Others noticed odd smells. But all were caught off guard when a loud boom sounded that day, and raging flames ripped through the roof.

Abernathy and McCabe made it out, but others weren’t as lucky. Found dead in the apartment were Abernathy’s daughter, Morgan, and her young cousin, Sammy Garbe. Joseph Raeth, a 69-year-old military veteran, died in a neighboring unit.

Assistant U.S. Attorney Peter Phillips told the court that investigators found a plastic bottle and meth ingredients in Abernathy’s master bathroom, evidence of the so-called “one-pot method” of making meth. They also found a Pyrex dish with meth residue and syringes Abernathy used to take the drug, he said.

From state drug records and witness statements, investigators learned that Abernathy had recruited family members and others to buy pseudoephedrine, a stimulant and decongestant used to produce meth, Phillips said. Witnesses had also seen him shaking the plastic bottle on occasion and McCabe crushing up pseudoephedrine pills, he said.

They reportedly went about making the drug while young Sammy and Abernathy’s 12-year-old daughter were in the apartment, Phillips said.

Abernathy and McCabe entered their guilty pleas in separate hearings, each clad in a prison jumpsuit with their wrists shackled to their waists. Neither had much to say, outside of answering “yes” and “no” to procedural questions posed by U.S. District Judge Richard Gergel.

Abernathy listened impassively while Phillips recited the evidence against him. When Gergel asked if he disagreed with any of the prosecutor’s statements, he shook his head.

“No,” he said. “Not a one.”

Abernathy faces the possibility of life in prison for his crimes because he has two prior felony drug convictions. Prosecutors, however, indicated he could have receive a reduced sentence of 20 years to life if he continues to cooperate and provides substantial assistance to authorities.

According to a plea agreement, McCabe, who faces 20 years to life in prison, could also see a shorter sentence if he continues cooperating.

Abernathy’s common-law wife, 36-year-old Alberta Pierson, and Michael Still, 19, also had been scheduled to appear in court Monday to change their not-guilty pleas in the case, but those hearings were canceled, according to court filings. Pierson and Still were each indicted in September on one count of conspiring to make meth.

All four suspects in the fire case were initially charged in state court, but authorities opted to pursue a federal prosecution because it would likely result in greater penalties.

Reach Glenn Smith at 937-5556