Oklahoma County Sheriff's Deputy Bobby Swartz seen in an undated photo.
CNN  — 

An Oklahoma County sheriff’s deputy was killed and another was seriously injured after being shot while serving a court order at a residence, officials said.

Sgt. Bobby Swartz died from his injuries, and the other deputy is in stable condition after being rushed to the hospital, the sheriff’s office wrote on its Facebook page.

“It is a sad day for the Oklahoma County Sheriff’s Office,” Sheriff Tommie Johnson III said during a news conference Monday as he held back tears.

The two deputies, described as veteran officers, were shot after interacting with the suspect as they served a lockout order, a directive from a court to leave a residence.

“We had two deputies that were serving papers, lockout papers, contacted the individual at the front door then went around to the back door and that is when the shooting began,” Johnson said during the news conference.

When one deputy was shot, the other deputy tried to get the injured deputy away from the gunfire, and he was struck as well.

The suspect fled the scene and was eventually taken into custody after the pursuit ended at a Tinker Air Force Base entrance, according to the sheriff.

Tinker Air Force base officials sent their condolences to the sheriff’s department and the families of the officers involved in the shooting, according to a statement.