ALFRED — Marissa Vieira had a moment of euphoria and then everything went black.

The next thing she remembers is the sound of people screaming and someone asking if she was OK.

Her eyes were open, she had stopped breathing and her skin had turned a deathly blue.

Vieira, an inmate at the York County Jail, nearly died this summer snorting heroin laced with fentanyl that had been smuggled in by another inmate. She was 23, the mother of a 3-year-old son who was living with family members.

“I was reckless,” she said during a recent interview at the jail. “I didn’t think you could OD like that, snorting it.”

Vieira was 15 when she dropped out of Noble High School in North Berwick to help care for her sister’s three children after her sister went to jail for dealing drugs. Vieira got a job working at Dunkin’ Donuts.

She was partying when she first tried Percocet and loved it. She started taking prescription painkillers recreationally, on weekends. For the first year, she could take it or leave it.

“Then it went to probably every other day. Then every day,” she said. She switched to 30-milligram OxyContins.

“Once you get to the high milligrams, it takes you pretty quick. You just realize how good you feel when you’re on it,” she said. It was the first thing she thought about when she woke and it consumed her day.

She quit for 13 months when she was pregnant with her son, but started up again within months of his birth.

Her addiction to prescription opiates lasted about five years, until a crackdown on pill diversion raised the price and she couldn’t afford them anymore. By then, her habit cost hundreds of dollars a day when she could afford it – and felt like the worst flu imaginable when she couldn’t.

Although for many products, a price increase might lead someone to spend less, economists who study the drug trade say that doesn’t always apply to opiates. Instead, a price hike leads heavy users to spend more or seek an alternative.

In the case of Vieira and thousands of others, the alternative was heroin.

“Heroin wasn’t even really around” when she started using pills, Vieira said. It was too scary. “I always told myself I’d never do it.”

But her pill addiction was too expensive.

“With heroin, you could spend $20 to $40 and get way more high,” she said. “That’s why a lot of people started. That’s why I started.”

She snorted heroin for the first time. “It felt great,” she recalled.

Drug trafficking organizations have now flooded the market with inexpensive heroin of exceptionally high purity, powerful enough to give someone a high from just sniffing or smoking it.

The Maine Drug Enforcement Agency has reported heroin purities of 50 to 87 percent in Maine, unheard of a decade ago.

The result: a steady clientele of addicts using heroin as a cheaper way to feed their addictions.

For Vieira, the day came three years ago when she had just $20 worth of heroin, not enough to stave off the sickness that resulted if she went a day without. Someone told her injecting it increased its potency, so she wouldn’t get sick.

It worked.

“That is a whole other level of euphoria” she said. “That’s why people do heroin all day long. They’re chasing that moment of the first shot.”

From then on, needles, as much as she hated them, were her method of delivery.

Vieira’s near-death experience in jail wasn’t her first exposure to an overdose.

She was using heroin with a friend in an old minivan in a Sanford parking lot when she noticed he wasn’t breathing. “It was one of the scariest things I’ve ever seen,” she said.

She had a choice: Take her friend to the hospital and risk arrest, or let him die.

“It was more important to know he was OK,” she said. “Maybe it’s different with people who they don’t care about and love.” She said she also felt a certain shared responsibility when people use together.

The incident made them both stop for a while, but she felt helpless.

“I told myself I wanted to quit every day,” she said. “You feel like a loser, an outcast. You’re separated from family and loved ones.”

To support her habit, Vieira had been stealing. She was first charged with theft two weeks after she started using heroin. This summer, she was charged with participating in a York County burglary ring. It was in jail that Vieira sought her escape, not physically but emotionally, through heroin that had been smuggled in.

But what she thought was just heroin was actually laced with fentanyl, a synthetic opiate up to 50 times more powerful than heroin.

When her family learned what happened, their reaction was worry, not anger, she said.

“They thought maybe I had done it on purpose,” she said. She said she feels lucky her family is so supportive.

“They still know who I am – their daughter.” She also feels lucky they are caring for her son.

Since her overdose, Vieira has focused on improvement, for her son’s sake. She is taking advantage of a range of education programs at the jail.

She obtained her GED and took college transition classes. She would like to be a veterinary technician after she is sentenced and serves her time.

Jail once was so bad, Vieira sought an escape through heroin. Now she feels it is the best place for her. Inside, she feels relatively safe.

“If I was on the outside, I probably would have gotten high,” she said. “I’m so done with that life.”