A judge has rejected a plea agreement that could have led to manslaughter and all other charges being dismissed against a southern Minnesota man whose gun was picked up by his girlfriend's 4-year-old son, who then fatally shot his 2-year-old brother.

Martin County District Judge Michael Trushenski on Monday tossed out the deal reached last month between County Attorney Taylor McGowan and the defense for 33-year-old Colton Mammenga of Welcome, Minn., in connection with the Oct. 15 shooting of Matthew Alshaikhnasser in a moving pickup truck.

The terms of the plea deal reached last month called for the dismissal of two counts of second-degree manslaughter and one count of negligent storage of a gun. In exchange, Mammenga agreed to plead guilty to felony child endangerment.

The deal also called for no jail time, no fines and for the plea to be entered under a stay of adjudication, meaning the conviction would have come off his record after adhering to the terms of his probation. The terms also included speaking at events about the negligent storage of guns.

However, McGowan told the Star Tribune, "from [the judge's] perspective, he believed it was too lenient. Now there will be further discussions between the parties to figure something out."

Defense attorney Christa Groshek said Wednesday that she said during Monday's hearing that "my client wanted to take responsibility because he didn't want to shirk the responsibility onto others."

Groshek added that "it's unclear where we're headed. We're trying to talk to the judge in chambers."

In a letter to the judge before Monday's hearing, McGowan called this case "one of the most difficult" he has handled as county attorney.

"A young child died as the result of an action that was accidental, yet at the same time criminal," McGowan wrote. "Mr. Mammenga is someone who loved that child and is no doubt punishing himself more than the state court could ever do."

McGowan said his rationale behind the plea's terms included Mammenga not being a threat to public safety and the desire for leniency expressed by the boy's mother, Annah Krueger.

"Colton provided a home for us that we felt safe in," Krueger said in her letter to the judge filed last week. "He helped me provide the boys with a structured routine that reduced stress on the children and myself. ... In my eyes he is [the boys'] dad."

Mammenga's attorney, Christa Groshek, explained to the court in writing, and consistent with the criminal complaint, how the seemingly routine actions of Mammenga and Krueger that day led to the shooting:

The couple and her boys were about to drive to her parents' home on farm property to prepare their firearms for the coming deer hunting season and do some target shooting.

Mammenga, who has a permit to carry a firearm in public, removed his pistol and holster from his hip as he sat in the front passenger seat and put them in the door's side panel.

Before departing, Krueger went inside to retrieve Matthew's stuffed dinosaur, and Mammenga went back in to get coffee for the trip.

While unbuckled and left alone in the pickup for a few minutes, the 4-year-old found the gun and shot Matthew a few minutes into their travels.

Using his training as a volunteer firefighter and ambulance crew member, Mammenga provided Matthew with cardiopulmonary resuscitation until emergency responders arrived.

Matthew was taken by air ambulance to a Rochester hospital, where he died two days later.

"Tell me, how am I supposed to explain to my 4-year-old son that because of the accident, Colton (Dad) must go away for some time," Krueger's letter to the judge read. "He already blames himself for Matthew's death. And now because he did this, Colton gets sent away too?"