Matthew W. Eck of Brown Hill Road in Boston has been indicted on felony charges in connection with the shots fired at two Erie County Sheriff’s deputies on March 16.

Eck, 48, was named in an indictment charging him with two counts of attempted murder in the first degree, two counts of attempted murder in the second-degree and second-degree criminal possession of a weapon.

He is accused of firing at Deputies Jonathan Hanna and Brad Ballantyne with an assault rifle when they responded to his residence for a domestic disturbance. Eck surrendered after a 12-hour standoff with dozens of police and deputies, including a SWAT team.

If convicted of the crimes, Eck faces a maximum prison sentence of 40 years.