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.
Jordana Brewster on Paul Walker: 'He was an enormous presence in my life'
Couple mistakenly served bag of cash at McDonald's drive-thru