HAVERHILL, Mass. (AP) — A Massachusetts teenager on Wednesday became the first person in the state to be convicted of causing a fatal traffic accident while texting, and a judge sentenced him to a year in jail.

Aaron Deveau of Haverhill was sentenced to 2 ½ years behind bars with a year to serve and the remainder suspended for the February 2011 crash that took the life of Donald Bowley Jr., 55, of Danville, N.H., and seriously injured Bowley's girlfriend.

Prosecutors say the then 17-year-old high school student sent 193 text messages the day of the crash, including some just a minute or so before impact and dozens more after it.

A Haverhill District Court jury convicted Deveau of motor vehicle homicide and negligent operation while texting. Family members of both Deveau and Bowley, sitting just feet from each other in court, cried and hugged as the verdict was read.

Deveau apologized to Bowley's family.

Now 18, Deveau, who had faced a maximum of four years behind bars, also was ordered to perform 40 hours of community service and surrender his driver's license for 15 years.

Police say Deveau's car crossed the center line on a Haverhill street and crashed head-on into Bowley's vehicle. Bowley, a father of three, died 18 days later of injuries authorities say he suffered in the crash. His passenger and girlfriend, Luz Roman, had an extensive stay in the hospital recovering from her injuries.

"This has been giving me a lot of pain. There are no words to describe," Roman said outside of court Wednesday.

Bowley's sister, Donna Burleigh, said, "We hope this sends a message that it's not OK to text and drive."

Deveau testified Tuesday, saying he was not sending or receiving text messages in the moments before the collision. He said he put his phone on the passenger seat and was distracted and thinking about his homework when the crash occurred. He told police after the crash that he swerved to avoid another vehicle in front of him that suddenly hit its brakes.

His lawyer, Joseph Lussier, said prosecutors failed to prove that Deveau was texting at the time of the crash. Lussier said the number of texts Deveau sent that day was irrelevant.