An anonymous caller claiming to speak for the Basque separatist organization ETA had warned that an explosive device would go off within 10 minutes. The explosion came around 6:00 am (O400 GMT).
A man suffered injuries to his ears and a woman was in shock after the blast. Both were taken to hospital and later discharged.
A government spokesman in Madrid said in a statement the device contained around one kg of explosives and "was similar to those used by the terrorist group ETA".
|"Device similar to those used by ETA"|
-- Spanish government spokesman
The spokesman added the device had been placed in a metal box overnight in a dustbin just outside the courthouse.
Police sources said one witness had noticed what appeared to be a biscuit tin outside the courthouse just prior to the blast while a youth reported seeing two men in the immediate vicinity minutes before the explosion.
The courthouse is located in the San Pedro old town of Estella, which is on the road taken by Roman Catholic pilgrims travelling to Santiago de Compostela to visit the shrine of Saint James, the apostle.
Estella Mayor Maria Jose Fernandez said after the explosion that ETA wanted to disrupt the tranquility on the road to Santiago, where pilgrims on Friday were scheduled to celebrate the Saint's Day of James.
ETA had also tried to break up celebrations of Saint Fermin, nearby Pamplona's local saint, in a foiled attack earlier this month.
On May 30, ETA in a deadly attack killed two paramilitary civil guards in Sanguesa, Navarra.
Last week police also defused a bomb in the region which borders on the volatile Basque region.
ETA over the past three decades has carried on an armed campaign for an independent homeland in northern Spain.