Sen. Michael Brady, a third-term Democrat from Brockton, agreed Tuesday to surrender his driver's license for 45 days and enlist in an alcohol use education program to resolve charges stemming from a drunk driving incident over a year ago when he was arrested in Weymouth.

Brady, 57, entered the plea agreement in Quincy District Court rather than proceed to a jury or bench trial. He admitted that the state had enough evidence to convict him, but avoided having to plead guilty. If he complies with the terms of the deal, all charges against Brady will be dismissed and he will not have a conviction on his record.

"I'd like my constituents and my colleagues in the Senate to know that I accept full responsibility for my actions that have resulted in today's decision. I understand the embarrassment that this brings to all of them, as well as to my friends and family," Brady said in a statement, in which he also spoke about his struggle with alcohol abuse.

The plea agreement resolves, for now, criminal charges that have been hanging over Brady since March 2018 when the senator was pulled over in Weymouth shortly after 2 a.m. on a Saturday and arrested for driving under the influence.

The Senate, however, could still open an Ethics Committee investigation into Brady's behavior, regardless of the outcome of the case. Senate President Karen Spilka said senators are taking the matter "very seriously."

Brady told police at the time of his arrest that he had been at a "work event" in Boston, and was on his way home to Brockton. The police report said Brady was observed swerving between lanes and off the road into a liquor store parking lot on Main Street in Weymouth.

Brady then failed multiple field sobriety tests, police said, and refused to take a breathalyzer test, resulting in a six-month license suspension. After the incident, Brady apologized to his constituents, colleagues and police and said he was admitting himself for a short time into treatment for alcohol use.

The senator was set to go to trial on Tuesday, but before the proceedings began Brady's attorney, Jack Diamond, told Judge Daniel DiLorati that he and the district attorney's office were working out a plea agreement.

Less than an hour later, Brady stood before the judge and admitted to the facts of the case as laid out by Assistant District Attorney David Way, including a police officer's description of him on the night of his arrest as having a blank stare, bloodshot and glassy eyes, smelling of alcohol and slurring his speech.

Under the deal, Brady agreed to go through an alcohol education program for first-time OUI offenders, to give up his license for 45 days, and to pay $600 in fines, plus $65 per month in probation fees for one year.

The OUI charge will be dismissed in a year if he successfully complies with the terms of the agreement, and the charge of negligent operation of a motor vehicle was dismissed. Brady was also found not responsible for marked lanes violations, a civil infraction.

The continuation without a finding in Brady's case is a common occurrence in Massachusetts courts, with over 50 percent of all OUI cases resulting in a similar disposition, according to a 2012 study of OUI cases commissioned by the courts. Way and Diamond described the agreement as "standard" for first-time offenders.

The 2012 study found that 73 percent of all OUI cases were resolved by plea agreement, with 69 percent of those deals resulting in a continuation without a finding, like Brady's case.

Brady declined to comment to reporters as he exited the courtroom and again when he left the courthouse, but said he would issue a statement. In that statement, Brady apologized for behavior that he called "not acceptable."

"Like many who have made the decision to confront alcohol abuse I understand that this is a problem for which I need help. I am thankful for the love and support of my family and so many friends as I seek to improve my life, literally one day at a time," Brady said.

The next question for Brady will be how the Senate approaches his plea deal. His case could be referred to the Senate Ethics Committee for review, and if he is found to have violated any chamber rules he could be disciplined.

The chamber's rules stipulate that "any finding or decision by a court of law or administrative agency, including the Massachusetts Commission Against Discrimination, which indicates sufficient facts to believe that the member, officer, or employee engaged in behavior which would constitute a violation of a Rule or other misconduct .... shall be referred to the Ethics Committee."

The committee, after a confidential investigation, could then recommend reprimand, censure, suspension or removal from office, or no action. Brady could also be stripped of his committee assignments.

Sen. Eric Lesser, the chair of the Senate Ethics Committee, did not respond to requests for comment on Tuesday, while Senate President Spilka said she wanted to review the transcript of Tuesday proceedings.

"The Senate takes this matter very seriously and we will want to review all the facts laid out in the transcript of this morning’s proceedings, when it is available," Spilka said in a statement. "I will need to consult the members of the Senate once those facts have been made available to determine next steps. The Senate will have no further comment on this matter at this time."

Brady drove himself to the Quincy courthouse in the morning, arriving about 15 minutes before his case was scheduled to be called, wearing a light blue suit and glasses. Someone was waiting to drive him away when he left.

Brady had been arrested once before, also in Weymouth, for driving under the influence in 1998 when he drove his car into a telephone pole. In that case, Brady, then a Brockton city councilor, appeared before a clerk magistrate and had the charges knocked down to civil infractions and he paid a fine.

This time the case was prosecuted by Norfolk District Attorney Michael Morrissey, a former state senator whose time on Beacon Hill overlapped with Brady's for two years from 2009 until 2011 when Brady served in the House.

Morrissey gave Brady $200 during Brady's special election campaign for the Senate in 2015, including $100 from his political committee and a $100 personal contribution. Brady also has given to Morrissey, once in 2010 when he wrote him a $100 check.

Brady served in the House from 2008 until 2015 when he won a special Democratic primary to succeed the late Sen. Thomas Kennedy, and went on to defeat former Republican state Rep. Geoff Diehl. He currently co-chairs the Committee on Public Service, which handles pension-related bills affecting public employees.

The Senate has a formal session on Thursday with an agenda that features public safety legislation that would require motorists to use only hands-free electronic devices while driving.