An earthquake of magnitude 5.2 jolted Afghanistan on Thursday, a statement by the National Center for Seismology said.