GOOD LORD: Police shot at a man 20 times in his own yard, thinking he had a gun. It was an iPhone.

Video released by the Sacramento Police Department depicts a frantic foot pursuit through darkened streets pierced by white slivers of police flashlight.

The officers spot Clark approaching a house and shout: “Show me your hands! Stop! Stop!”

Clark is seen running, and the two officers round the corner of the house and find him under a covered patio.

An infrared camera on an overhead helicopter briefly loses sight of Clark at this moment.

“Show me your hands! Gun!” an officer shouts and ducks behind the wall in a fraction of a second.

The helicopter footage shows one of the officers appearing to grab his partner to pull him to cover.

Clark steps toward the officers. Behind the wall, one of the officers issues another command. “Show me your hands!” And then: “Gun, gun, gun!”

Both officers open fire. Sparks from the bullets light up the helicopter’s infrared camera in sharp white pops.

The sequence, from the first glimpse of Clark on the patio to the first gunshot, unfolds in about six seconds.

The officers are never heard identifying themselves as police before fatally shooting Clark.

What a mess.