A magnitude-5.4 earthquake hit western Afghanistan at a depth of 10 kilometers on Tuesday, according to the European-Mediterranean Seismological Center.