FALMOUTH — Everything finally seemed back on track. David was home for a short visit and looked happy, calm. He had a job, a girlfriend, a plan. His father, Kevin McCarthy, came home from work that Thursday and smiled to see his son take his dog, Kima, named for the drug-fighting detective on “The Wire,” out for a long walk.

When David came back, father and son settled in to watch their Patriots play the Jets on “Thursday Night Football.” David gave his father grief about the TV being too small: “Come on, Dad, get with the 21st century.” Near halftime, David got up and said he was going to watch part of the game at a friend’s place.

When David returned an hour later, they watched the end of the game together. The Patriots won, barely. Kevin went to work the next morning, and he returned home Friday afternoon at 4:30. It was to be David’s last night at home before he drove up to Sugarloaf Mountain to spend the winter at the family’s ski place, working in a restaurant, his passion.

Kevin, who had moved his family to this splendid spot on the Maine coast after finding the life of a high-powered Manhattan attorney too frazzling, and Nancy, David’s stepmother, had decided against taking David out to dinner on his last night home — there would be too much temptation to drink. Why risk it with David on the good path? So Kevin had gone out, bought a steak and thrown it on the grill.

Then he heard whining from upstairs. Kima, David’s black Lab.

“Dave? Dave!” the father yelled up.

He heard just the dog. He went up, opened the door and saw David’s feet on the floor. His boy was cold.

“It was pretty clear he was dead,” the father said. David was 29.

The needle was on the bed, next to him. The spoon was on the nightstand. A crystalline substance glistened in the spoon.

Kevin tried to revive his son, pumping, pushing, pleading. He called 911. He argued with the operator, who had the location wrong. The operator kept telling Kevin to calm down.

The next 20 hours were a blur of police sirens, ambulances, drug agents, cops, friends and the rest of the family, now coming home for the worst possible reason.

All of that hell — even before a second son overdosed on heroin, the very next night.

CHEAP, PLENTIFUL, POTENT

They were kids who had it made, at least on paper. The McCarthys’ rambling farmhouse on U.S. 1, not a quarter-mile from the ocean, had a separate wing for the boys. They called it The Bunkhouse. They had cars, money and plenty of independence, like many teens in Falmouth, a town of 11,000, a place of privilege just across a short bridge from Portland, the state’s largest city.

It’s a place now ravaged by heroin — four overdoses, two of them fatal, in the past 10 months, in a town more accustomed to nothing of the kind. Maine is at the burning core of a nationwide heroin epidemic, the perverse outcome of a well-intentioned drive to save Americans from the last drug craze, a widespread hunger for heroin’s chemical cousin, prescription opiate pills such as Oxycontin.

Heroin — now cheap, plentiful and more potent than ever — is killing people at record rates. Across the nation, deaths from heroin overdoses nearly quadrupled in the decade ending in 2013, according to a new analysis by the Centers for Disease Control and Prevention.

In Maine, deaths from heroin overdoses ballooned from seven in 2010 to 57 last year. Two-thirds of the victims were, like David, adults in their 20s and 30s. In 2012, heroin accounted for 8 percent of the caseload for Maine’s Drug Crimes Task Force; last year, it jumped to 32 percent. In Portland, the number of addicts served by the needle exchange nearly doubled in just two years. Today in Maine, a single tablet of Oxycontin often costs $50; addicts can find a single-dose packet of heroin for as little as $10.

David and his friends, like their parents, always thought of heroin as an inner-city scourge, something for strung-out, dead-end junkies. An entirely different trajectory had been set for them.

David’s mother, Anne Ireland, an artist, took him down to New York a couple of times a year to see Broadway shows. Cute and friendly with his tousled hair and toothy smile, David was the youngest of her three boys; she wanted him to be a kid who liked to sit and read, like his brothers. She limited their TV to weekends, “with the ‘Seinfeld’ exception,” she said. But what had worked for her older boys didn’t seem to take with David.

“He was always different,” she said. “He had every opportunity. He had parents who loved him. He seemed to reject that for the love of his peers. He wanted so desperately to be cool and older.”

When David was starting at Falmouth High School, his parents split up. Beginning in 10th grade, he lived with his father; his relationship with his mother frayed.

David and his friends started smoking marijuana in middle school. “We all shared this land of being a little different from the rest of the family, almost black sheep,” said John Palman, a longtime friend. “We were all the youngest siblings, with successful older sibs.”

In 10th grade, one of David’s stepbrothers, Michael, an avid snowboarder, suffered an injury and was prescribed codeine and then Oxycontin, an opiate painkiller. It was an at-will prescription; he could get more whenever he wanted. Michael — whose family asked that he be identified by his middle name — offered some pills to David and his friends.

Soon, David was buying Oxys from a guy in the grocery store parking lot.

“The driving force was to test the unknown,” said a high school friend of David’s who spoke on the condition of anonymity because he was admitting to extensive drug use. “I thought I wasn’t in the lower socioeconomic group, so I’m not going to get hooked like people of that group.”

Oxys were no party drug. They were, the friend said, “a drug of isolation.”

But David and his friends had a group of their own, too — affluent kids such as David, and kids from the other Maine, the towns where mills once flourished, where too many people now have too few options. At a suburban school such as Falmouth’s, teens from both worlds came together. “You’re sitting next to the kid who’s in the country club, and you’re not anywhere near that social strata,” Falmouth Police Chief Ed Tolan said.

David’s group coalesced around drugs, mostly marijuana and pills. A decade later, drugs remained their bond, but they had stepped up to something far more deadly.

‘HE DECIDED I WAS THE ENEMY’

The day before David’s funeral, one of his high school friends, a woman with whom he had a romantic relationship that lasted more than a year, wrote about him on Facebook: “I think I lost the moon while I was counting the stars. . . . we ALWAYS found our [way] back to each other. . . . I will always love u and cherish what we had my first love. David McCarthy may angels lead u in.”

The woman who wrote that tribute was one of two high school friends who supplied David with heroin, according to McCarthy’s parents, friends and the police.

“We call her the angel of death,” Tolan said. These were kids he had watched grow up. The chief says he believes David’s old friend sold drugs to at least three of the town’s four overdose victims in the past year.

The woman was the love of David’s life in high school, his mother said. “He wanted a girlfriend so desperately,” she said. “I hardly knew her; he didn’t bring her home. He’d decided I was the enemy.”

Two law enforcement officials said the woman and another high school friend, a man who also grew up in Falmouth, supplied heroin to their old friends in Falmouth and Portland. The man sold the fatal heroin to David and, the next night, to his stepbrother, the officials said.

The woman, who is not identified here because she has not been charged with a crime, was anguished by David’s death. “I’ve been here in my bed since last Saturday,” she wrote a week after the overdose. “It’s safe here and I can cry as much as I want and re-read letters” from David.

The next day, she alerted her friends that she was leaving town: “I’m packin what will fit in my purse and im running away. I’m gettin in the car with the first stranger that picks me up whether they have candy or not.”

“Candy,” according to friends and police, was the code word for heroin that the woman used on social media to alert friends when a new shipment arrived in town.

Her Facebook page is a jarring collision of mundane domesticity, devotion to her young son, and chesty boasting about her erratic nightlife — drinking, drugs, sex and her night job as a stripper. Accounts of parent-teacher conferences bump up against invitations to get wasted. “Happy birthday to my little man” follows “Shout out to the ladies that keep their clothes on and make money. I’m not one of them but good for y’all.”

The woman, in a brief meeting at her apartment in a subsidized building in an artsy, gentrifying section of Portland, initially agreed to talk about David and drugs. But she never came through on that promise and later ignored requests for comment. Her grandmother, whose house she often visits, said the woman rarely responds to calls and mostly sleeps her days away.

The woman has lived in a succession of subsidized apartments; there’s no sign of big profits from her drug sales. Police and prosecutors say that’s not unusual: The heroin trade bears little resemblance to the street corner traffic associated with crack or PCP.

In Falmouth and Portland, heroin is often sold by addicts operating out of their own homes. They drive south on Interstate 95 to depressed cities in Massachusetts, to Lowell, Lynn or Lawrence, where they connect with Dominican and Mexican gang members selling cheap heroin from Mexico, now the source of most heroin in the United States.

The dealers from Maine bring back just enough to sell to friends, using their narrow profit to satisfy their own cravings. Sometimes, gang members from Boston, New York or Pennsylvania drive north to Maine and set up in an addict’s apartment, selling for a day or two until the package is gone, paying their hosts with free or discounted heroin.

Then, a few days later, they get on the road and do it all over again.

HEROIN USE UP; DRUG STORE ROBBERIES DOWN

Starting in high school, David and his friends would do Oxys in the car. Grind up the pill, snort it, go back to the house, smoke pot, watch TV. Repeat.

Two years after David finished high school, his stepmother opened a drawer in the room he shared with Michael and found piles of little packets. The boys told her it was cocaine. She learned years later that it was heroin.

The switch to heroin happened because their regular Oxy supplier had run short. “It wasn’t even a 20-minute conversation,” said a friend who was with David that day. “It was really just that we couldn’t get what we usually got, and we knew it was clinically basically the same drug.”

The guys snorted heroin, usually a couple of times a week, for years. Shooting up was something they saw in scary movies. But over time, they built up a dependence. They needed a fix just to get by, and they needed ever more to get high. They found themselves acting out of desperation — not breaking into strangers’ homes, but stealing from their parents.

Four years into his heroin habit, David, having seen his friends shoot up, tried to do it to himself. He couldn’t. “Dave had a serious aversion to needles,” said a friend whom David called to ask for help injecting the drug.

“One hundred percent of the people who come in here say they never thought they’d put a needle in their arm,” said Steve Danzig, a drug counselor who has worked with families in Falmouth, including the McCarthys. “But for somebody who’s been using, it’s not that big a step. Often, it’s curiosity: You see somebody shooting up, and it’s clear he’s much higher than you are. And it’s often a financial decision, because you can get much bigger bang for the buck shooting it.”

After a decade of widespread over-prescription of opiates such as Oxycontin, Percocet and Vicodin, the federal government pressed pharmaceutical makers to reformulate pills to make them difficult to snort, and it required physicians to prescribe fewer of the habit-forming pills. After Oxycontins were reformulated in 2010, street availability of the pills tightened; prices shot up.

“There can be no argument: Heroin has become much cheaper in the past two years because the crackdown on Oxys made it much harder to get pills on the street,” said Dan Perry, the assistant U.S. attorney in Maine who is in charge of drug cases.

“It’s like a metastatic cultural cancer — we went from virtually no intravenous drug use three years ago to now rationing care in a raging, untreated epidemic,” said Mark Publicker, a physician who ran the Mercy Recovery Center, Maine’s largest outpatient drug detox program, until it shut down last month because neither private nor government insurance would pay enough to cover its costs.

In Falmouth, the turn from pills to heroin was evident in the decline of robberies at pharmacies. Opiate pills used to be stored behind the counter, and addicts knew it; an after-hours break-in could keep them flush with pills for months. Then pharmacies changed their practices; prescriptions for opiates now must be called in 24 hours in advance, and only the amount prescribed is delivered to the store. In the past two years, Tolan said, pharmacy robberies have largely ceased, replaced by heroin’s surge.

For David and his friends, scoring their next fix was as easy as texting a friend.

TOO MUCH PRIDE

Four years ago, hooked and broke from spending his restaurant salary on drugs, David called his mother and told her he had no place to live. He and his old high school girlfriend had broken up. Would Anne take him in? Mother and son hadn’t lived together for nearly a decade. She brought him home.

“It was so painful to see him, not because of drugs, but because he was so directionless,” said Anne, a small redhead with a New Yorker’s metabolism. “I didn’t know what to talk to David about. He was into rap and didn’t read a lot of books. The TV was always on BET. I knew nothing about his life, really. I just worried about him, constantly.”

David wore his hoodie up when he was around his mother. He looked gaunt, worn. “He was this spectral presence,” she said. She took his salary and put him on an allowance. She thought he’d been spending his money on pot. He stole from her, nearly $1,000 that she had hidden where she kept her best jewelry.

One day, she came downstairs to find a jar of yellow liquid on the kitchen counter. “He had pissed in a jar,” she said. “He just lost all sense of decorum, appropriateness. He didn’t care.”

She told him he could not live with her anymore. He sent her an angry email laced with curse words.

Last year, about six months before David died, he called his friend John: He had shot up and later awakened to find that an entire side of his body had gone numb. John arranged for David to be taken to a hospital, where he was told he had suffered a minor stroke.

Kevin had it out with his son. “I’m done — you lied to me, you’ve taken advantage of everything we’ve tried to do for you,” the father told his boy. And he cut him off — no more money, no more living in the family’s ski place.

John had long urged David to get help. “He’s going to die,” John told David’s friends. “I was saying it, but I wasn’t doing anything about it.”

David thought he could get off the drug by himself. He told friends that heroin wasn’t fun anymore and that he wanted to quit. He had been through detox programs and short-term rehab, but they hadn’t worked. He had too much pride to ask his parents for the $30,000 he would need for a long-term rehab stay. Somehow, his father said, David managed “to put together six or seven months of sobriety, doing it on his own.”

By last summer, his parents said, David seemed to have found his way forward. He looked better, clean-shaven. He was running six miles a day.

“He finally seemed like a man,” Anne said. “So alert, so in the world. And then he decided not to be.”

NEEDLES AT THE SKI HOUSE

The McCarthys hardly ever talked about the boys’ drug use. When David was fired from a summer job on a neighbor’s lobster boat, the neighbor told Kevin, “Look, it’s not my place, but I think there’s something going on with drugs.” Kevin asked the neighbor to give David another chance; the neighbor refused.

“We just pretended they were going to be all right,” Kevin said. “They were sending signals saying ‘help’ all the time, and we didn’t act.”

He found needles up at the ski house. He sometimes saw tracks on David’s arms.

“I thought I knew a lot of things, but I didn’t,” Kevin said. “You’re in a community and you want to protect your child, but you also want your child to succeed. It’s a problem a lot of people in my social sphere don’t want to acknowledge.”

Around town, there have been whispers about young people on heroin, but the topic is not something that people discuss openly. “There’s a lot of families out here that would never, ever admit there’s a heroin problem,” said Tolan, the police chief.

Gary Palman, the father of David’s friend John, is a pain management doctor who spent two decades writing thousands of prescriptions for the same opiate pills that teens in town were abusing. “We flooded the streets with these medications,” he said. “It took us years to realize opiate medications can have profound abnormalities for society.”

Gary Palman said he felt so bad that he left his specialty and now practices anesthesiology. He wishes his former colleagues in pain management would recognize an obligation “to objectively see if a drug is working, and if it isn’t, to take it away.”

It remains easier to hide heroin’s impact in a place such as Falmouth than in a big city. Young people lose jobs, drop out of college, get evicted from apartments, but “their parents help them out,” Tolan said.

Three local addicts described how their parents stepped in to prevent the state from taking their young children away. In Falmouth, even after a young addict intentionally set his parents’ house ablaze, the parents wouldn’t let him talk to police.

“Even though he burned their house down,” the chief said, still amazed months later.

“People we know always looked away when heroin was mentioned, because it’s associated with the ghetto and the underclass,” David’s mother recalled. “In these affluent communities, achievement and success are paramount. If you don’t achieve, it’s ‘You had all these advantages and didn’t do anything with it.’ There’s not a lot of tolerance of kids who are different. If you’re not cut from that cloth, it’s a hard place, so you find friends who are like you, and you find huge relief in leaving the world.”

THE FENTANYL FACTOR

The night after David died, Michael slept in that same bed. In the morning, his mother knocked on the door, seeking help planning David’s funeral. No answer.

She stepped inside and saw her son lying rigid, his arms above his head. His breathing was labored, raspy. She screamed.

Kevin called 911, again. A physician who was training ambulance personnel nearby responded and administered Narcan, which reverses the effects of an overdose. Portland’s public health department offers addicts free Narcan kits, but the city is not permitted to use federal or state money for Narcan; its supply is privately donated.

Police found a heroin packet in Michael’s room. He spent the rest of the day in intensive care, his survival in doubt. The family camped out in the hospital, making calls about David’s funeral while they awaited word of Michael’s fate.

On the morning after David died, Michael had asked a friend, “Wouldn’t it just be easier to die young and not have to see your loved ones die?”

That night, Michael had called his old high school friend and dealer, the same man David had been to see two nights earlier.

“Do you really want that stuff?” the dealer asked. “It’s the same stuff that killed David.”

The stuff was heroin cut with fentanyl, an opiate that in its legal, prescription form is used to treat post-surgery pain. “People think they’re using heroin, and it turns out to be fentanyl,” said Jamie Guerrette, the assistant attorney general in Maine who runs the state’s drug task force. “We’re making seizures where users and even sellers believe it’s heroin, and it’s actually a mix that’s potentially 30 to 50 times more potent.”

Fentanyl was found in 11 of Maine’s 57 heroin overdose deaths last year, according to Marcella Sorg, an epidemiologist who is a consultant to the state on drug issues. In its powdery, synthetic, illegal form, fentanyl has been showing up in overdoses around the country.

When addicts unwittingly ingest heroin laced with fentanyl, they consume a vastly more intense dose than they had anticipated. Heroin used to reach Maine in single-dose “tickets;” now, the drug primarily arrives in “fingers,” 10-gram plastic-wrapped cylinders that are “cut,” or diluted, locally.

Michael didn’t believe the heroin would hurt him because he never shot up; he thought snorting was somehow safer. He used it that night, by himself.

Three days after Michael got out of the hospital — one day after David’s funeral — Kevin and Nancy, two other relatives, and four of Michael’s friends surrounded him and read letters they had written. Within a minute, Michael agreed to be taken to rehab. Danzig, the counselor, took the bag they had packed and flew Michael to a Florida trauma center. He stayed in rehab for two months. At the end of the program, he asked to stay another month.

The intervention cost $5,000; the treatment, $25,000. Insurance covered none of it.

Six months later, so far, so good, his family says.

“I realize I’m grasping at straws,” Kevin said, “but we like to think David saved Michael’s life.”

TELLING IT STRAIGHT

David’s parents decided they had to tell it straight. They owed him that. They wrote his obituary, published in the local papers: “David Paul McCarthy, 29, died of a drug overdose on Friday, Oct. 17, 2014, losing a long-fought battle with drug addiction — a challenge faced by many families today.”

The dealers in the McCarthy case have not been arrested; investigations are ongoing. Prosecutors and police say they are not eager to imprison addicts who sell drugs — they would rather get those people into treatment and enlist their help in going after dealers who bring heroin into the state.

“If you work overdose deaths, then you’re not working the organization above that,” said Perry, the prosecutor. “Overdose deaths are a priority because of the magnitude, the impact of a death, and because they’ll lead us to the groups that are causing the devastation.

“This is not something we’re going to arrest our way out of. We need families to get the problem out of the shadows.”

On a glorious fall day, 400 people packed the Episcopal Church of St. Mary. A hundred more stood outside, although the service was not broadcast outside the building. They were people the McCarthys hadn’t expected to come. They were, David’s mother said, “people with secrets, secrets like ours.”

“The WASP-y Yankees of Falmouth, generations of blond, blue-eyed social x-rays, they all came,” Ireland recalled. “These are the people I thought were so snooty. I mean, after we got divorced, I overheard a woman say they didn’t want their daughter to go with David because we were divorced. But those same kind of people, after he died, came to my door with soup and just hugged me and said, ‘You were a good mother.’

“It was a huge outpouring of love and sympathy and people saying, ‘It was so brave and good of you to put that in the paper.’ ‘We’re so glad you called it what it is.’ ”