Something wasn’t right: a man known to have violated his probation was boarding the ferry in Vineyard Haven and heading for Woods Hole, instead of being in custody.

Oak Bluffs police officer Jeff Trudel spotted Jason R. Willoughby, 26, of Edgartown, because they were on the same 8:15 a.m. ferry last Friday, Oct. 21. Officer Trudel and the black Labrador Buster — the two form Oak Bluffs’s new K-9 drug unit — were headed to the mainland for a training session, a police spokesman said.

While on the ferry, Officer Trudel made some phone calls and learned that Mr. Willoughby had been mistakenly released from the Dukes County Jail the night before, said police Sgt. Michael Marchand. When Mr. Willoughby came off the boat, Officer Trudel detained him until Falmouth police could take him into custody, he said.

“It doesn’t surprise me,” said Sgt. Marchand. “Jeff is very heads-up.”

Because of an administrative mix-up at the jail, Mr. Willoughby had been mistakenly released at about 5:30 p.m. Oct. 20, after posting $250 bail on drug charges stemming from his arrest earlier in the week.

That arrest, however, had put him in violation of his probation on a 2010 drug charge; so Edgartown district court clerk magistrate Liza Williamson issued an order that he be held without bail until his next court appearance.

Jail officials apparently saw the paperwork for the $250 bail but not the probation violation order. “We should not have released him,” said sheriff Michael A. McCormack. “Somebody should have picked it up.”

The sheriff said the jail processes more than 1,000 people per year, and occasionally an error occurs, but luckily Mr. Willoughby was caught before he got out of reach. “He’s in custody,” he said Friday. “That’s the good news.”

Mr. Willoughby was returned to the Island for a court hearing Monday, during which bail was set at $1,000.

In February, he was given a suspended sentence and placed on two years probation after pleading guilty to a distribution of a class E drug (Xanax) charge stemming from a July 2010 Oak Bluffs case.

Last week, Edgartown police and Martha’s Vineyard Drug Task Force officers served a search warrant at the Edgartown house where they said Mr. Willoughby was living. Off of his room, police said, they found a “grow room” with marijuana plants and plastic bags containing what appeared to be marijuana. In a second room, the owner of the house, Gabriel Grasing, 35, had a safe in which what appeared to be marijuana was found, police said.

Mr. Willoughby faces charges of distributing a Class D drug, possession of a class D drug to distribute and drug violation near a school or park. Mr. Grasing was charged with possession of a class D drug to distribute and drug violation near a school or park. The house is within 1,000 feet of a preschool, according to documents filed with the court.