Three people were charged with distributing a bad batch of heroin after police linked them to four of nine non-fatal overdoses Friday.

A Machiasport man and two others were arrested at 11 p.m. Friday after police found evidence that they sold heroin about five hours earlier to two overdose victims in Machiasport and a third in East Machias, said Stephen McCausland, spokesman for the Maine Department of Public Safety.

The three overdoses occurred in about 30 minutes. The victims were two men and a woman, all in their 30s. First responders used Narcan, a brand name for the anti-overdose drug naloxone, to revive them. Two were hospitalized and released Saturday, McCausland said.

[Police say bad heroin caused 9 overdoses on Friday]

A fourth overdose in the Hancock County town of Franklin occurred two hours after the Washington County overdoses. All are suspected to be connected to the three arrests, McCausland said in a statement Sunday.

Having four overdose victims inside three hours “created a flurry of activity in the law enforcement community, to say the least,” said Darrell Crandall, commander of the Maine Drug Enforcement Agency units in northern Maine.

The urgency of the situation compelled the Hancock County Sheriff’s Department on Saturday to issue a warning about the bad heroin on its Facebook page.

“All of the agencies involved immediately made an all-hands-on-deck commitment,” Crandall added Sunday. “You don’t know, when you have a large number of overdoses like this in a very short period, what’s going to happen next. You have to be prepared for an even-worse-case scenario.”

[Maine saw 418 overdose deaths in 2017, continuing a deadly trend]

Jon Wright, 50, of Machiasport was taken into custody on a previously issued MDEA arrest warrant charging him with unlawful trafficking in heroin.

Agents obtained a search warrant for a home on Cutler Road in Machiasport, where the three were arrested. Authorities seized 12 grams of crack cocaine, three grams of suspected heroin and $934 in cash from the home, McCausland said.

Based on the seizures, Leanza Boney, 20, of Harlem, New York, was charged with unlawful trafficking in heroin. Jesse Michaud, 38, of Machias was also taken into custody for violation of bail conditions.

More charges are likely and more arrests are possible, Crandall said.

The other five overdoses do not appear to be related to those in Washington and Hancock counties, police said.

The number of Mainers who died from drug-induced deaths rose to 418 in 2017, compared with 376 who died the previous year, according to the Maine attorney general’s office.

Investigators do not know exactly where the heroin originated from or what it was mixed with, Crandall said. They assume that these kinds of overdoses involve heroin combined with fentanyl, an opioid used for anesthesia and analgesia, according to the U.S. Drug Enforcement Administration.

Fentanyl is the most deadly drug typically added to heroin, police said.

The number of deaths in 2017 was driven by a sharp 27 percent increase in deaths from illegal fentanyl and fentanyl analogs, while heroin deaths decreased, officials have said.

In 2017, fentanyl killed 247 people and five died as a result of carfentanil, a fentanyl analog.

Traffickers often lace heroin with fentanyl and sell fentanyl as heroin because fentanyl is cheaper to make and the profit margin for dealers is higher.

No further overdoses connected to Friday’s cases had been reported as of Sunday, Crandall said.

“We are quite confident that we went to the right place for the right reasons,” Crandall said.

BDN writers Judy Harrison and Meg Haskell contributed to this report.

Follow the Bangor Daily News on Facebook for the latest Maine news.