Flowers, candles and crash debris mark the spot of a fatal accident.Three young adults were killed when the car they were riding in veered off the road and collided with a tree. The driver fled the scene and was arrested several hours later. (Ricky Carioti/WASHINGTON POST)

In the hours before his Toyota Corolla veered off the road and struck two trees and a telephone pole, killing three of his friends, 20-year-old Kevin Coffay had gone out partying, Montgomery County’s top prosecutor said Monday.

Montgomery State’s Attorney John McCarthy said in court that investigators were awaiting the results of a blood test to determine whether Coffay, of Rockville, was drunk when he crashed on a wet, curving road in the Olney area just after 3 a.m. Sunday. But he said Coffay had gone to at least two parties and had bloodshot eyes and smelled of alcohol when officers found him three hours later.

After he was taken into police custody, Coffay blurted out that the four friends in the car with him were “all fine” when he climbed from the wreckage and walked into the nearby woods, McCarthy said. In reality, three of his friends were dead or dying. The fourth, McCarthy said, watched in astonishment as Coffay left.

“He just got out of the car . . . leaving them all,” McCarthy said at a bond hearing Monday in Montgomery County District Court.

As prosecutors worked to piece together the events leading up to the crash — saying they intended to track down and interview partygoers — young people and parents in the close-knit Magruder community mourned the three who died.

Haeley N. McGuire, 18, was weeks away from graduating from Magruder High School in Rockville, Coffay’s alma mater, friends said. Spencer Datt, 18, of Derwood and John Hoover, 20, of Rockville were Magruder graduates who had gone on to college, said people who knew them.

At the scene of the crash, still strewn with broken glass and half of a bumper, flowers and half-burned candles were left behind after a candlelight vigil. Grief counselors were on hand at Magruder, where students shared memories of their friends. And in the courthouse, teenagers and adults wiped tears from their eyes as a judge set a bond that amounted to $50,000.

“Everyone’s just hoping we can all get through this,” said Joanne McGrew, a Magruder parent who attended the hearing. “The whole community is at a loss.”

Coffay, in a blue jail-issued jumpsuit, stood with his head down and his hands crossed in front of his waist as he appeared via closed-circuit TV for the hearing. He is charged with failure to immediately return and remain at the scene of an accident involving bodily injury and other related counts, authorities said. He had not been charged with any alcohol-related violations, and authorities said the investigation was ongoing.

Michael J. McAuliffe, Coffay’s attorney, said in court that Coffay acted as any “panicky young man” would when he left the scene and that he “wasn’t a guy who was taking off.”

McAuliffe said Coffay, a James Madison University student, may need treatment for depression, noting that his 58-year-old father had recently moved into a facility for treatment of advanced Alzheimer’s disease and that his mother had cancer.

“The family is devastated,” McAuliffe said, adding that Coffay’s mother, brother and sister attended the hearing but did not wish to speak to reporters. “It could be any of our kids, including mine.”

Police and prosecutors said Coffay was driving a silver 2007 Toyota Corolla east in the 4700 block of Olney Laytonsville Road when he swerved, striking two trees and a telephone pole. Much of what investigators know beyond that seems to have come from the surviving passenger, Charles A. Nardella, 19, a Magruder High School graduate who lives in Gaithersburg.

Nardella told detectives Coffay had gone to two parties before the crash and had been drinking, McCarthy said. He also told detectives Coffay was speeding at the time of the crash, McCarthy said.

By the time police arrived, Coffay had left on foot, officers said. McCarthy said that officers twice spotted Coffay during a search after the crash but that he ignored their calls to stop.

Authorities said Coffay eventually met up with a friend who drove him to the Cutlass Drive home where the Coffay family lives. Police arrested him in the driveway nearly three hours after the crash and took him to a nearby hospital.

McCarthy said that Coffay had a previously citation for a traffic violation in an incident in which he drove over two mailboxes in the early-morning hours. Online court records show he also has been charged with an alcohol violation in Virginia.

Coffay’s Facebook page shows he had worked as a lifeguard and was active in a fraternity.

At Magruder High on Monday, where students are finishing up the school year, more than 100 of McGuire’s friends, classmates and teammates convened on the hockey field after classes. Photos of McGuire playing hockey were affixed to a fence at the end of the field. “Haeley” was spelled out with crumpled newspapers on another fence nearby, her name punctuated with a heart.

“You’ll always keep Haeley alive in your hearts,” said the team’s coach, Kathleen Mulholland.

McGuire was heading to the University of South Carolina on an academic scholarship, her friends said. She had just gone to the prom and had a graduation party this Saturday and a trip to the beach coming up shortly thereafter. She loved the beach almost as much as she loved hockey, friends said.

“Everyone loved her for her positivity,” said Colleen Harwood, a Magruder senior who had known McGuire for a decade. “She was always bringing everyone up.”

Staff researcher Magda Jean-Louis and staff writer Dan Morse contributed to this report.