Letcher County Sheriff Mickey Stines, 43, was taken into custody without incident at the Letcher County Courthouse, where District Judge Kevin Mullins, 54, was shot and killed, Kentucky State Police said in a statement.
Police offered no motive for the shooting. Stines has been charged with one count of first-degree murder.
"There is far too much violence in this world, and I pray there is a path to a better tomorrow," Kentucky Governor Andy Beshear said on X.
Kentucky Attorney General Russell Coleman wrote on social media that his office would be working with special prosecutors on the case, writing "we will fully investigate and pursue justice."
The Kentucky Court of Justice wrote on its social media that the court "is aware of a tragic incident that occurred today in Letcher County" and that it offered its full support to state police in their investigation.The shooting took placein Whitesburg, the Letcher County seat, about 220 miles (350 km) southeast of Louisville and near the Virginia border.
The Mountain Eagle reported from the courthouse that Stines walked into the judge's outer office and told court employees he needed to speak with Mullins alone. The two closed the door to the inner office behind them and later shots were heard. Stines walked out with his hands up and surrendered to police, the Mountain Eagle said.