BANGOR, Maine — The mother of a man who distributed cocaine and oxycodone in Kennebec County collapsed Thursday in sobs into the arms of her lawyer when a federal judge said she would spend two years behind bars for being part of her son’s drug smuggling operation in central Maine.

Robin Brown, 57, of Harlem, N.Y., will lose her job at a New York City hospital and the rent-controlled apartment where she has lived for 30 years unless she returns home by the end of the month, defense attorney Bruce Merrill of Portland said in U.S. District Court.

She pleaded guilty May 29 to one count each of conspiracy to possess with intent to distribute and distribution of cocaine and oxycodone and possession with the intent to distribute oxycodone and aiding and abetting the same. The drug conspiracy Brown admitted being a part of was headed by her son, Maurice “Mo” McCray, 33, of Waterville.

“She’s not a criminal,” Merrill told U.S. District Judge John Woodcock. “She’s not a drug dealer. She happens to have a drug dealer for her son.”

Brown lost one son to gang violence in 1994 and was terrified she would lose another, the defense attorney said in a passionate plea for mercy. She got involved to help her son pay off what he said was a large drug debt after she and her family were threatened.

Initially, Brown gave McCray her own prescribed oxycodone pills, Merrill said. As her son’s drug trafficking continued, Brown became more involved and served as a go-between for him with suppliers and brought oxycodone pills herself to Maine for him. She also recruited other relatives, including her husband, to bring drugs to McCray in Maine.

“She did not benefit from this operation financially,” Merrill said. “She did it because she was afraid he was going to die.”

Merrill said that after she was arrested May 30, 2012, in New York City along with her husband, Tyrone Pereira, 48, of Harlem, N.Y., Brown insisted that her son would “get her out of the situation.” But when Merrill spoke with McCray’s attorney, Marvin Glazier, he learned it wasn’t true.

“I told him that my client is waiting for your client to explain how she got involved,” Merrill said. “He says that’s not going to happen. It turns out the first person the feckless coward gave up was his mother.”

Merrill urged the judge to sentence Brown to six months in jail and six months of home confinement, which would allow her to work, so that she could keep her job and apartment. As of Thursday, she had served all but 11 days of a six-month jail term while awaiting sentencing.

Assistant U.S. Attorney Joel Casey, who prosecuted the case, recommended Brown be incarcerated for two years and eight months, far below the recommended federal sentencing guideline sentence of between 46 and 57 months.

Casey said Brown was “one of the least likely drug dealers the government has ever seen. She has no criminal history. She has a job. She had lost one son to a shooting years ago and was going to do whatever was necessary to save another. But when she was called by Mo nearly two years ago she made a choice and she chose wrong.”

Woodcock said he was sympathetic to Brown’s situation but could not impose the sentence Merrill urged.

“The way Mr. Merrill frames this case, he views it solely as a case about a mother’s love for her son,” the judge said in imposing the sentence. “You don’t save your son from drug dealing by joining a drug conspiracy. Each day in this courtroom, I see the consequences of drug dealing.”

In addition to prison time, Woodcock sentenced Brown to three years of supervised released.

Pereira and McCray have pleaded guilty to drug charges. Pereira is scheduled to be sentenced Nov. 22. McCray is not expected to sentenced until next year.