The explosion came after day-long battles in the northern port city of Tripoli between Lebanese troops and members of Fatah al-Islam in which at least 37 people were killed.