Three people, including a woman from Fairfield and two Boston men, were arrested after a monthslong Waterville drug investigation, the Police Department announced Friday.

The three were involved in bringing crack cocaine and heroin from Massachusetts to Waterville to sell, according to a news release from Deputy Chief Charles Rumsey. They were arrested Thursday on Elm Street after the car they were in was stopped.

A fourth woman, who wasn’t identified by police, was arrested at the same time.

The three also are believed to have accepted stolen merchandise in exchange for drugs, according to the release.

Arrested were:

• Hannah C Maheu, 18, Totman Court, Fairfield, charged with one count of possession of a scheduled drug (heroin), a class C felony; one count of possession of a usable amount of marijuana and one count of possession of drug paraphernalia. Her bail was set at $500 cash, and she has a court date of July 27 in Kennebec County Superior Court. She was taken to the Kennebec County jail after her arrest.

• Domingos Cabral Jr., 26, of 79 Bellevue St., Boston, and Kevin R. Pires, 25, of 855 Cambridge St., Boston, both charged with two counts of class A felony aggravated trafficking of scheduled drugs. Their bail was set at $300,000 surety, and they are both due in court July 27 and are being held in the Kennebec County jail.

Police arrested the three Thursday after officers stopped a car driven by Pires on Elm Street about 5:10 p.m.

Pires, Cabral and Maheu, who were all in the car, were taken to the Waterville Police Department, where they were searched.

The search revealed that both Pires and Cabral had multiple baggies of crack cocaine and heroin “secreted between (their) buttocks” and that Maheu had eight baggies of marijuana in her bra, Rumsey said in the release.

Pires had 16 baggies of crack cocaine, with a total weight of 6.6 grams, and nine baggies of heroin totaling 2.7 grams, according to the release. He was also in possession of more than $150 in cash.

Cabral had 12 baggies of crack cocaine with a total weight of 12.4 grams, and 18 baggies of heroin totaling 23.9 grams. He was also in possession of over $1,500 in cash. Maheu also had a baggie of heroin and drug paraphernalia in her purse, police said.

Waterville police had been investigating the drug trafficking ring for several months, and believed it was responsible for importing and selling large quantities of crack cocaine and heroin in the city, according to Rumsey. He said the investigation was complicated by the fact that Pires and Cabral “frequently changed the residences from which they operated.”

Police also suspect Cabral and Pires of accepting stolen merchandise in exchange for drugs. Property believed to have been stolen from local businesses, including clothing, liquor and a 32″ LED TV, was found in the car’s trunk, police said. The vehicle that was seized was later found to have been rented by Pires.

While the operation was being executed, officers saw a female known to them as being wanted by the Maine Drug Enforcement Agency. The female — who was on foot, walking by — was detained and turned over to drug agents, who arrested her.

Both Cabral and Pires have prior drug convictions from Massachusetts, which elevated the crimes they are charged with to class A felonies. A class A felony is punishable by up to 30 years in prison and a fine of up to $50,000.

Waterville police were aided by Fairfield police, whose female officer searched Maheu.