Habakkuk to 1 Chronicles
The head of the wicked severed.
Saul's Beheading
Habakkuk ends with a prayer. In the prayer Yahvah is described as delivering his anointed by cutting off the head of the wicked. The first story in First Chronicles is the death of King Saul. Saul fell on his own sword to prevent being mistreated by the Philistines who were closing in around him, but when the Philistines found him they cut off his head anyhow. This is the beheading in Habakkuk's prayer.
So if Saul is the "wicked" whose head was cut off to deliver Yahvah's anointed, then who is Yahvah's anointed? David, of course. David had been anointed by the prophet Samuel to reign over Israel after Saul. Saul was jealous of David's anointing, which gave him military victories and rapport with the nation, and he sought to kill David in an attempt to keep the throne in the family. David was on the run from Saul for a long time to preserve his life, despite trying to reconcile a number of times and passing up more than one opportunity to take Saul's life.
The clue Habakkuk is adding to this story is that Saul's death was Yahvah's doing. The mechanism Yahvah used was the Philistine army, but he could have caused them not to war against Israel or delivered Saul's life. Habakkuk is saying that this was a deliverance for David. Since David had entrusted his life to Yahvah, and would not himself take the life of Yahvah's anointed, which at that time was Saul, Yahvah took Saul's life when it was time. The irony is that Saul, despite knowing David was anointed to be king after him, attempted time and again to end David's life. The contrast is what makes Saul wicked and David worthy.