A truck packed with explosives blew up near a court in the eastern Afghan city of Gardez on Thursday, killing at least five people in an attack claimed by Taliban insurgents.