Stevens and and three other Americans were killed on Tuesday when suspected Islamic militants fired on the US consulate in the eastern Libyan city with rocket-propelled grenades and set it ablaze.
Megaryef said "a few" of those who joined in the attack were foreigners, who had entered Libya "from different directions, some of them definitely from Mali and Algeria."
"The others are affiliates and maybe sympathizers," he added.
Megaryef said the government has learned the attack was not the result of a spontaneous outburst of anger over a US-made anti-Islam movie which has triggered sometimes deadly protests in the Arab and Muslim world.
"It was planned, definitely, it was planned by foreigners, by people who entered the country a few months ago. And they were planning this criminal act since their arrival," he told CBS.
Al Qaeda in the Arabian Peninsula has said in a statement the attack was in revenge for the killing of the terror network's deputy leader Sheikh Abu Yahya al-Libi in a drone strike in June.