A 27-year-old Milton man was sentenced to three years in state prison Monday for trafficking cocaine on the Vineyard.

The sentence was the outcome of a plea bargain agreement. Fernando A. Jesurum pleaded guilty in Dukes County Superior Court on charges of trafficking in 18 to 36 grams of cocaine and intimidation of a witness. He was sentenced to three years to three years and a day at Massachusetts Correctional Institution Cedar Junction, a maximum security prison in Walpole, and ordered to serve two years of probation after the prison sentence. A third count, distributing a class B drug (cocaine), subsequent offense, was dismissed at the request of the commonwealth.

Mr. Jesurum was also ordered not to use illegal drugs and to undergo random drug screens and to seek treatment if found appropriate by probation. He was ordered to pay $240 in fees and a $65 monthly probation services fee. He was also ordered to forfeit $315, which will be split between the district attorney’s office and the Edgartown police department.

Carlos G. Stevenson. — Mark Lovewell

The case dates to June 2013 when Mr. Jesurum was arrested in the area of the Vineyard Haven Steamship Authority terminal following an eight-month drug task force investigation into cocaine distribution on the Island. Task force officers had followed Mr. Jesurum between Boston and the Vineyard. After obtaining a search warrant, police arrested him after he exited a Steamship Authority ferry.

In court Monday, Cape and Islands assistant district attorney Laura Marshard said “a significant amount of cocaine,” more than 24 grams, was found in plastic bags on his person, specifically down his pants. There was a struggle, she said, during which Mr. Jesurum maneuvered so that the bags of narcotics ripped and spilled.

The maximum sentence for the cocaine trafficking charge is 15 years in state prison, Ms. Marshard said, and 10 years in state prison is the maximum sentence for intimidation of a witness.

She said Mr. Jesurum “has a substantial record that warrants state prison.” The plea agreement was struck between the commonwealth and Mr. Jesurum, represented by his attorney Robert Moriarty.

The Hon. Richard J. Chin, associate justice of the superior court who is presiding over the superior court session this month, accepted the agreement.

In other court business Monday, Carlos G. Stevenson, 48, of Vineyard Haven, was arraigned on six counts, including aggravated rape of a child with force.

Mr. Stevenson pleaded not guilty to all six counts.

Ms. Marshard, the assistant district attorney, said the charges date to a period between 2001 and 2003. The alleged victim was 10 to 13 years old at the time and was known to Mr. Stevenson. Ms. Marshard described one incident when Mr. Stevenson allegedly threatened the victim after assaulting her and told her not to tell anyone.

Matthew P. Tucci. — Mark Lovewell

Ms. Marshard asked that $9,000 in bail paid in district court be transferred to superior court. Other conditions of his release included no contact with the alleged victim and her family and no unsupervised content with females younger than 17. A pretrial hearing was scheduled for Dec. 19.

Matthew P. Tucci, 32, of Boylston, was also arraigned Monday. Mr. Tucci was indicted earlier this month on two counts of possession to distribute a class A substance (heroin), subsequent offense and two counts of failure to register as a sex offender.

The drug charges stem from arrests in March and July of this year. In March, Mr. Tucci was arrested after the drug task force conducted a search warrant at a home in Vineyard Haven, according to a police report. Police allegedly confiscated items associated with drug distribution, including a brown powdery substance consistent with heroin.

In July, Mr. Tucci was arrested on Sea View avenue extension in Oak Bluffs. According to a police report, Mr. Tucci allegedly attempted to swallow something as police approached him, and police allegedly located a backpack containing 11 individually wrapped bags of powder believed to be heroin.

According to police, in both instances Mr. Tucci had been staying on the Vineyard but had failed to register as a sex offender as required by law. In 2002, Mr. Tucci was convicted in Dukes County superior court on a statutory rape charge.

Mr. Tucci’s bail was set at $5,000.