Seventeen people were killed in Tajikistan on Wednesday in an attack on a border post that officials blamed on ISIS group militants who had crossed over from Afghanistan.
Tajik security forces killed 15 when an armed and masked gang attacked the checkpoint on the border with Uzbekistan.
A soldier and a policeman also died in the fighting, officials said, AFP reported.
The clashes near the Tajik capital Dushanbe broke out as the country prepared to celebrate Constitution Day on Wednesday and the country's long-serving President Emomali Rakhmon was on a visit to Switzerland.
Rakhmon is also expected to visit Paris later this week to meet with French President Emmanuel Macron as part of a rare European visit.
After questioning several detained militants, the Tajik border guard service said the men were members of the ISIS group who had crossed the border from Afghanistan on Sunday.
"All (of them) are members of the so-called terrorist group 'ISIS'", the border guard service said in a statement.
The interior ministry released pictures of several bodies in black clothes lying next to burnt-out vehicles at the scene of the clash.
The militants crossed the border in the south of Tajikistan and apparently trekked to the site of the attack on the border with Uzbekistan, which is around 200 kilometres away.
The armed gang of around 20 masked people attacked the Ishkobod border post located some 50 kilometres (30 miles) west of the Tajikistan capital after 3 am local time Wednesday, the interior ministry said.
"As a result of an operation conducted by law enforcement forces, 15 members of an armed criminal group were neutralized and four more attackers detained," stated.
The country's border guards said separately that five attackers had been detained.
According to AFP, tens of thousands of people were killed in Tajikistan during a five-year civil war in the 1990s.