A spokesman for the Pakistan Taliban's Jamaat-ur-Ahrar faction claimed responsibility for the attack in the northwestern town of Charsadda.
The district administration said at least four people were killed. A witness told Reuters he had seen "many" dead bodies at the scene.
Also Read- 4 suicide blasts in one day kill 6 in Pakistan
A string of bombings in Pakistan over the past 10 days has killed more than 100 people.
Town resident Mohammad Shah Baz told Reuters he was inside the judicial complex when the suicide bombers stormed it.
"I escaped towards the canteen and climbed the wall to save my life. But there were many people dead and injured," he said.
Also Read- Suicide attack on Pakistani shrine claimed by Islamic State kills 72
District police chief Sohail Khalid said at least one of the attackers blew himself up and another opened fire at the main entrance of the court compound before they were shot and killed.
Jamaat-ur-Ahrar spokesman Asad Mansoor claimed responsibility the attack in a message to journalists. He said fighting was still going on at the court.