A federal judge has released a police dash cam video showing a Missouri police officer using force and a stun gun on a teenager who went into cardiac arrest.

Former Independence Officer Timothy N. Runnels was sentenced last week to four years in federal prison after pleading guilty to violating the civil rights of 17-year-old Bryce Masters during a Sept. 14, 2014, traffic arrest. The video was played in court during Runnels' sentencing hearing, The Kansas City Star reported.

Police said Masters was uncooperative during the stop. The video shows Runnels instructing Masters to get out of the car, and Masters can be heard asking Runnels why and whether he is under arrest.

Runnels then can be seen trying to pull Masters out of the car and uses the stun gun on Masters. The stun gun continues to discharge for about 20 seconds. After Masters goes limp, Runnels can be seen handcuffing the teen and dragging him to the curb, where he drops him face down onto the pavement.

Runnels called for an ambulance after a few minutes but did not check on Masters. When the ambulance arrived, Masters was in cardiac arrest. He was taken to a hospital and put into a medically induced coma and treated for lack of oxygen to the brain.

Masters nearly died, according to court testimony.

Masters testified recently that he is forgetful and has difficulty focusing as a result of the incident.