An Oklahoma inmate who escaped by posing as his cellmate and then posting bond was captured by U.S. Marshals at a motel in St. Louis, Missouri, ending a dayslong manhunt.

Patrick M. Walker, who was serving a life sentence for first-degree murder, was taken into custody Tuesday morning, according to the Oklahoma Department of Corrections.

“We deeply appreciate the dogged, tireless efforts of the U.S. Marshals to take Patrick Walker into custody,” state corrections chief Joe M. Allbaugh said in a press release. “Fortunately, they were able to capture him without incident, and he will soon be back in Oklahoma.”

Patrick M. Walker was arrested by U.S. Marshals at a St. Louis motel after escaping from an Oklahoma jail on Dec. 4, 2018. Courtesy of U.S. Marshals

Federal marshals said he was able to flee to Missouri with the help of a woman, the Kansas City Star reports.

Walker, 34, escaped from the Payne County jail in Stillwater on Nov. 29. Authorities said he was able to walk out of the jail by impersonating another prisoner named Charles Pendarvis, whom he "closely resembled."

Walker, know as "Notty Walker," then convinced someone to post bond for Pendarvis, and pretended to be him when a bondsman came.

Matt Elliott, a spokesman for the Oklahoma Department of Corrections, said Pendarvis was "threatened" into giving his ID to Walker so he could escape.

Director Allbaugh said he wants a full report on "how one of our most dangerous inmates could bond out of a county jail."

Walker had been in jail since 2003 before his escape. He was originally housed at the Oklahoma State Penitentiary but was transferred to the county jail for a court hearing after he allegedly assaulted a corrections officer.