There was no immediate claim of responsibility for the attack but for years, NATO supply trucks have been targeted by Pakistani Taliban and other militants.
While the U.S. has over the years reduced its reliance on Pakistani routes to ferry materials to its troops across the border, the routes that run through Pakistan are still crucial to the war effort.
In Monday's attack, the militants emerged from the mountains and lobbed rockets at the NATO trucks, setting fire and completely burning two vehicles, said local official Iqbal Khan.
The militants wore local police uniforms and the four dead included truck drivers and their assistants, he said.
The attack took place in the Jamrud area of the Khyber tribal region, through which runs the main route into Afghanistan for the supply trucks. The trucks' journey often begins from the southern port city of Karachi.
Government official Jehangir Azam told DunyaNews TV that around 15 heavily armed militants were involved.
"It was a very organized attack," he said, adding that the trucks carried a NATO jeep, an ambulance and other materials. U.S.-led coalition forces say they only transport non-lethal supplies overland through Pakistan.
TV footage from the scene showed the vehicles engulfed in flames.
The route through Khyber is one of two entry points into Afghanistan used by the Americans, and t's also a key entry point for regular trade with Afghanistan. Militant attacks on the supply line have frustrated NATO.
Pakistan has at times closed the route to vent its anger over NATO actions, including airstrikes that have killed Pakistani soldiers.
As a result, the U.S. has increased its use of more costly routes through Central Asia to get supplies into Afghanistan. However, even as foreign troops withdraw from Afghanistan over the next year and a half, the routes across Pakistan will still be crucially important.
Associated Press Writer Asif Shahzad contributed to this report from Islamabad.