Tunisian security forces killed five militants near the Libyan border on Wednesday in a gunbattle in which one civilian also died and an army commander was wounded.