An Ohio gamer has been jailed for his part in a “swatting” prank that ended with cops shooting dead an innocent Kansas dad.

Casey Viner, 19, was so upset by losing a $1.50 wager while playing “Call of Duty: WWII” online, he recruited another man to report a fake hostage scare on his rival in 2017, federal court in Wichita heard on Friday.

The Wichita address he gave was wrong — and one of the armed SWAT cops who stormed the house ended up killing innocent 28-year-old Andrew Finch.

Viner appeared crestfallen as he was sentenced Friday to 15 months in prison — having assumed he was escaping jail time after pleading guilty in April to felony charges of conspiracy and obstruction of justice.

He told U.S. District Judge Eric Melgren he was “awfully sorry” and “never intended for anything to happen.”

“I think of it every day,” he told the court, with his attorney, Jack Morrison, saying the teen had lost 20 pounds over the “gravity” of what he thought would be a “harmless prank.”

As the unexpected prison sentence was announced, the teen’s tearful mother left the court, and his dad — an Ohio law enforcement officer — put his head into his hands.

“We impose sentences not only for what people intend, but what happened,” the judge told Viner, who had admitted to initially trying to hide his part in the deadly prank.

The suburban Cincinnati teen is also restricted from gaming for two years once he’s out on supervised release after serving his prison term.

“Swatting, and soliciting others to swat someone, are more than foolish,” US Attorney Stephen McAllister said after the sentencing.

“Such actions are reckless, dangerous and, as this case proves, potentially tragic. Swatting is not a prank, and it is no way to resolve disputes among gamers.”

Tyler R. Barriss — who actually made the fake hostage call — was sentenced in March to 20 years in prison after pleading guilty to 51 counts for making fake emergency calls and threats around the country, including the deadly hoax call in Kansas. Prosecutors believe it is the longest prison sentence ever imposed for “swatting.”

The officer who shot Finch said he thought he’d been reaching for a gun because he moved a hand toward his waistband. The officer was never charged, with prosecutors ruling that he had every reason to believe Finch would be armed because he was responding to a hostage alarm.

With Post wires