Officials said 10 soldiers were also killed in the fighting.
"At least 38 militants were killed and 10 soldiers were martyred," Zakir Hussain Afridi, the Bajaur administration chief, said as he showed 18 bodies of fighters in the presence of local forces commanders.
He said security forces destroyed two Taliban hideouts and arrested 23 fighters during the clashes.
Troops mounted another offensive in Bajaur earlier this year and declared the terrain to be free of Taliban in March.
Commanders claimed an earlier victory in February 2009, but violence returned when the military turned its attention to fighting the Taliban in South Waziristan and Swat, also in the northwest.
Pakistani troops have been fighting in Bajaur since August 2008, trying to wipe-out Taliban and al-Qaeda hideouts, but there are indications that the Taliban is trying to make another comeback.