An Oak Bluffs man was sentenced to four years of probation, and ordered along with his co-defendant to pay full restitution, after pleading guilty Monday for his part in the 2011 theft of $85,000 from an elderly Oak Bluffs man.

Daniel Ben David, 49, pleaded guilty to charges of unarmed robbery and larceny over $250 Monday morning before the Hon. Cornelius J. Moriarty 2nd, an associate justice of the Superior Court.

Outlining the commonwealth’s case for the court, Cape and Islands assistant district attorney Laura Marshard said that Mr. Ben David and Stanley Johnson, 52, also of Oak Bluffs, broke into the Oak Bluffs man’s home in March 2011 and stole a safe containing about $85,000 along with personal documents and prize possessions. The identity of the man, who is now 77, is being withheld.

The money was said to be the man’s life savings. Mr. Ben David ultimately returned over $30,000 to the police, who returned the money to the victim, Ms. Marshard said. The police also recovered more than $5,000 from Mr. Johnson, which was being held as evidence.

Mr. Johnson was found guilty by a jury last week, and he was sentenced to between five and seven years in state prison.

Mr. Moriarty agreed to most of the probation terms set forth by Ms. Marshard and agreed to by Mr. Ben David’s attorney, Robert Hofmann. They included four years of probation, remaining drug and alcohol-free, having no contact with the victim or trespassing on his property, maintaining employment, submitting a DNA sample and informing the court of his financial condition every six months.

However, Judge Moriarty was more severe when it came to Mr. Ben David’s restitution. Mr. Ben David had already paid about 75 per cent of his portion of the $85,000, Ms. Marshard said, and the original agreement called for him to repay the rest of his portion. But Judge Moriarty said that he and Mr. Johnson would together be responsible for the remaining amount, about $44,000.

During the sentencing, Judge Moriarty had stern words for Mr. Ben David. “Theoretically, I could sentence you to 25 years in prison,” Judge Moriarty told Mr. Ben David, emphasizing that he could serve that time if he ended up violating his probation.

“The district attorney’s office is well aware of Mr. Ben David’s record,” Ms. Marshard said, noting past convictions on drug charges, including drug trafficking. She said that in this case, the situation was aggravated by Mr. Ben David’s close relationship with the victim’s family, namely his son.

However, “the commonwealth would not have been able to prosecute Mr. Johnson without the cooperation of Mr. Ben David,” Ms. Marshard said, adding that “he returned over 75 per cent of his proceeds before the district attorney’s office became involved.”

She said his cooperation and returning the money were significant mitigating factors. “I ask the court to accept this because the DA’s office recognizes that justice would not have been served but for his cooperation,” she said.

Mr. Hofmann said that Mr. Ben David is from the Vineyard, and said he has a history of substance abuse, which he said would be addressed through probation conditions like random screens.

“Clearly, under almost any other circumstance you would be going to state prison for a significant amount of time,” Judge Moriarty told Mr. Ben David during sentencing. “In my view, you are the mastermind of this event.”

He said the fact that he targeted an elderly man and the father of a close friend made the circumstance “extremely despicable.”

These facts “do, frankly, make it very difficult to go along with this recommendation, but I will,” he said.

He credited Mr. Ben David’s “decency to admit his involvement” and said the court recognizes that prosecutors sometimes have trouble getting perpetrators to serve time. “Often times they have to make a deal with the devil in order to make sure other perpetrators don’t go unpunished.”

But he added: “I give you good warning, sir, if found to violate terms of probation you are going to spend an awfully long time in state prison.”

Mr. Moriarty said he personally would retain jurisdiction over the case, and he suspended fees so that money could go toward restitution.

After the sentencing, Mr. Ben David had no comment other than “I’m sorry.”

“I know it was very stupid,” he said as he was leaving the court room.