WATERVILLE — An Elm Street man and a Skowhegan man were arrested this week after selling heroin and cocaine to undercover police officers near a elementary school, police said.

Wayne Foster, 35, of Waterville, and Brandon Sanford, 31, of Eaton Mountain Road in Skowhegan, were arrested on Thursday after a two-week investigation of the two for selling drugs from Foster’s home, which is near Albert S. Hall Elementary School, according to Waterville Police Chief Joseph Massey.

Undercover officers bought heroin and crack cocaine from both Foster and Sanford earlier this month, which led to a search warrant, Massey said.

Before searching Foster’s home on Wednesday, police acted on information they received that Foster also sexually assaulted his ex-girlfriend, Massey said.

Police interviewed the woman at MaineGeneral Medical Center in Augusta before arresting Foster at his home at 14 Elm St., Massey said.

Police found small amounts of heroin and cocaine, a 9mm pistol and evidence of the sexual assault when they searched Foster’s home, Massey said.

Foster was charged with three class A felonies, two of aggravated trafficking and one of aggravated assault. They each carry maximum penalties of 30 years in prison and $50,000 in fines.

The aggravated trafficking charges stem from the distance of the apartment from the school. Drug trafficking within 1,000 feet of a school zone elevates the trafficking charge to aggravated.

The aggravated assault charge is elevated because Foster has two assault convictions, in 2004 and 2005, Massey said. Massey expects the district attorney’s office to add a sexual assault charge once it is done reviewing the evidence.

Foster made an initial appearance Friday in Augusta District Court via video from Kennebec County jail at which Judge Beth Dobson set bail at $10,000 cash, saying the charges are particularly serious.

Assistant District Attorney David Spencer told the judge the assault on the woman was “quite brutal” and that the victim was interviewed by an assistant district attorney in the hospital Thursday. Spencer asked for Foster’s bail to be set at $50,000.

Attorney William Baghdoyan, who represented Foster at the court appearance, said Foster had no felony convictions and no criminal involvement in more than eight years.

Baghdoyan said the woman named as victim was an acquaintance of Foster’s and that Foster worked at a grocery store, but was laid off.

Baghdoyan also questioned the affidavits provided to support the drug charges against Foster and Sanford. He said the affidavits provided identical information about the alleged drug sales to an unidentified confidential informant on Nov. 21 and Dec. 4.

“It’s unclear to me whether my client’s being charged as an accomplice or as a principal,” Baghdoyan said, while representing Foster.

He proposed $1,000 cash bail for Foster. “The thousands of dollars asked for by the state is essentially denying bail,” Baghdoyan argued.

The investigation later led police to Sanford, who was arrested leaving 48 Church St. in Clinton, Massey said.

Officers found a small amount of heroin, drug paraphernalia and $1,000 in cash at the Church Street residence.

Sanford was charged with two counts of aggravated trafficking.

Dobson set his bail at $1,000 cash or $10,000 surety. Both require a Maine Pretrial Services contract.

Baghdoyan also represented Sanford. He said Sanford has lived in Skowhegan for the past five or six years and works full time to support his girlfriend and their three children.

Jesse Scardina — 861-9239[email protected]Twitter: @jessescardinaBetty Adams — 621-5631[email protected]Twitter: @betadams