Tajik security officials told RFE/RL today the fighting took place on December 27 in Bogh, in Khatlon Province's Shuroobod district.
The officials, who requested anonymity, said that after three hours of fighting the border guards requested air support.
A combat helicopter opened fire on the intruders and forced them to retreat into Afghanistan.
The officials said several smugglers and two Tajik soldiers were killed during the gun battle.
Local residents say three Tajik servicemen died and that two of them may have been victims of friendly fire from the helicopter. The Tajik military denied that anyone was killed by friendly fire.
Alamkhon Rahmatov, who commands the Tajik border-guard unit in the area, told RFE/RL the border was currently quiet and no incidents had been registered in the past three days.
Illegal border crossings, robberies, and kidnappings of Tajiks by Afghan drug smugglers are not unusual.
In recent years, armed Afghan smugglers have seized dozens of Tajiks as well as cattle from villages in Khatlon close to the border.
Local authorities and analysts say smugglers usually kidnap Tajik accomplices who owe them money for drug shipments.
In related news, Tajik National Security Committee spokesman Nozirjon Buriev told RFE/RL on December 26 that the previous day Afghan security services handed over four Tajiks who had illegally entered Afghanistan from Tajikistan.
Buriev said two of the four -- Hikmat Aziziov and Bahromjon Orifov -- were escapees from the August 22 jailbreak from a high-security prison in Dushanbe.
He said the other two, Rustam Tohirjonov and Ikrom Otaboev, were suspected members of the banned Islamic Movement of Uzbekistan and had been charged with serious crimes.
Buriev said that three more escapees from the August jailbreak were also being held in Afghanistan, but since they were Afghan citizens the Afghan authorities wanted them to stand trial in Afghanistan.