A 22-year-old Coatesville man was sentenced to 31 to 62 years in prison for the shaking death of his 5-month-old daughter in 2018 caused while he was in a rage over being insulted by another player during an online video game, the Chester County District Attorney’s Office said Monday.

Zion Shockley, who originally was charged with first-degree murder in the death of Rosalie Faith Crothers-Shockley, pleaded guilty to third-degree murder, aggravated assault, and endangering the welfare of a child.

“My client has accepted responsibility and hopefully it will bring closure to everyone involved,” said Laurence Harmelin, Shockley’s attorney.

Shockley, then 18, was at his grandparents’ home in Coatesville playing an online video game when another player disparaged his game-playing skills, prosecutors said.

Angered, Shockley picked up his infant daughter, threw her in the air, and then violently shook her for a minute, prosecutors said.

Shockley was playing “Call of Duty” on his PlayStation, according to news accounts at the time.

He saw his daughter was not breathing but did nothing, prosecutors said. A relative later saw the infant and called for help.

Investigators found out about a similar incident that happened six weeks earlier and involved Shockley getting angry after losing a video game and shaking the infant for five minutes.

The girl, who had suffered internal bleeding in her brain and eyes, died at a hospital two days later.