STAMFORD — Darien police officers Daniel Ehret and James Martin, arrested last year after a car was shot up outside Martin’s house, were granted accelerated rehabilitation by a Stamford Superior Court judge on Friday.

The two had been charged by state police with reckless endangerment, breach of peace and unlawful discharge of a firearm. In the early hours of Aug. 1, Martin, under the influence of alcohol and in the company of Ehret while off-duty at Martin’s home near Interstate 95, fired 11 shots from a personally owned pistol at his car, investigators said.

The case gained widespread media attention because, at the time of the incident, both had worked for the department 10 years in good standing. Ehret won the Medal of Bravery in 2013, the department’s highest honor, for coming to the aid of two people aboard a sinking boat of the coast of Darien.

Both officers were placed on administrative leave following the incident until March 21, when Darien Police Chief Duane Lovello issued a statement announcing that a decision had been reached by the Police Commission to return Ehret and Martin to work with “disciplinary suspensions of 60 days, conditions on their work for the next 60 days, restrictions on promotions and special assignments for two years, and the potential for termination without right of appeal if there are repeat violations of Departmental General Orders for the next five years.”

Ehret’s attorney, Michael Fitzpatrick, began the hearing by stating that the court was familiar with the facts of the case and that Ehret met all the conditions of an accelerated pretrial rehabilitation program, which is available to defendants who have committed certain crimes if the court believes those defendants will probably not commit more crimes in the future.

“Since Mr. Ehret’s arrest he has accepted responsibility, he has shown remorse and he has turned a negative into a positive. He’s back at work. He’s a public servant and he’s doing good work in the community,” Fitzpatrick said.

Martin’s attorney, John Robert Gulash, said, “their past exemplary work and their prospects of similar work in the future.”

Both men solemnly apologized to the court and expressed regret for their actions last August.

“As unfortunate as it was, I think a lot of good came out of it,” Ehret added.

“To whom much is given, much is expected,” Judge Richard Comerford said following the officer’s apologies, quoting from the Gospel of Luke.

“Public servants have a very, very, difficult job ... They’re held to very high standards. Sometimes these standards are not only difficult, but almost impossible to attain. We are human beings and we do make mistakes. We are fallible,” Comerford said, before granting Ehret and Martin accelerated rehabilitation with 50 hours of community service, in addition to the punishment administered by the Darien Police Commission.

The Court Support Services Program will monitor the officer’s progress over the course of a year to ensure they are following the court’s orders.;