The policemen were ambushed on Monday on their way to introduce a newly appointed district police chief to officers in Helmand province, Interior Ministry spokesman Yousuf Stanizai said.
"Eighteen police, including the Helmand province police director Amanullah Khan, were martyred last night in an ambush," he said.
Four other policemen were wounded.
Stanizai blamed the attack on "enemies of peace", a term Afghan officials use to refer to insurgents from the ousted Taliban government believed to be behind almost daily attacks in southern Afghanistan.
"The exchange of fire between the police and the enemies went on for several hours, even up to 1am," he said.
It was unclear how many casualties there were among the attackers, he said.
Aljazeera learned that the policemen were heading towards the Dishoy area to appoint a new police chief after the assassination of the former police chief by suspected Taliban fighters.
Mazin Aman Allah, Aljazeera's correspondent in Kabul, said the security situation in the country has been deteriorating since the resignation of the previous Afghan interior minister.
In a separate incident late on Monday, four Russian-made rockets were fired on Kandahar city in adjacent Kandahar province, which is also caught up in the fighting, Stanizai said.
No one was hurt by the rockets, one of which landed near the headquarters of a foreign-run reconstruction team.