A 24-year-old man was given a 30-year prison term for beating his girlfriend's 3-year-old son in a western Minnesota residence during a "fit of rage" against the crying child.

Sterling K. Andersen, of Ogema, was sentenced in federal court in Minneapolis last week after pleading guilty to second-degree murder in connection with the October 2015 death of Steven Warren at the couple's home on the White Earth Indian Reservation.

As part of the plea agreement, Andersen avoided the possibility of a life term.

Emergency responders were called to the home about a boy with a head injury and took Steven to a nearby hospital, where he was declared dead and found to have more than 2 dozen bruises on his head, abdomen and genital area, as well as injuries to internal organs.

In a court filing before sentencing, the prosecution said Andersen acted against the boy "in a fit of rage that had been building for more than 20 years" and beat the boy for more than an hour.

The boy's pancreas "was severed in half, and his liver was torn," the court document noted, adding that Steven "was tossed around like a doll."

After initially contending that Steven hurt himself in a fall, Andersen told investigators he punched and kneed the child because the boy would not stop crying.

Andersen's criminal history as a juvenile and an adult includes convictions for assault, disorderly conduct and theft.