The attack on forces of the Infantry Second Brigade occurred on a road between Bani Walid and Tarhouna, The Tripoli Post reported.
A military official said the attackers drove vehicles equipped with machine guns, the BBC reported.
The identity of the attackers is not clear, but Bani Walid was a stronghold for supporters of former dictator Moammar Gadhafi in 2011.
The military blocked off the area road after the attack, CNN reported.
2014: The Year in Music [PHOTOS]