One of the attackers who were believed to be about five in number was killed in retaliatory action by security forces, police said.
The police said that a group of heavily-armed militants, wearing army fatigues, came to the crowded weekly Balajan Tiniali market, about 12 km from here, in a van around noon and fired indiscriminately killing 12 persons on the spot and injuring more than 20 others.
Prime Minister Narendra Modi strongly condemned the attack and said the Home Ministry is in touch with the Assam government.
"Saddened by the attack in Kokrajhar. We strongly condemn it. Thoughts & prayers with the bereaved families & those injured," he tweeted.
Also Read
"The Home Ministry is in touch with the Assam Government & is monitoring the situation closely," Modi added.
The dead included a woman who was yet to be identified while six others have been identified as Mazhar Ali, Salam Ali, Danda Basumatary, Moniram Basumatary, Parmeswar Basumatary and Tapan Chakraborty.
Manik Debnath, a 30-year-old shop-keeper who was a witness to the mayhem, said that about five militants, wearing army uniforms and covering their faces arrived in a van and fired continuously, which continued for 15 to 20 minutes.
"A grenade was also lobbed by the militants which set on fire eight shops and screaming people began to run helter-skelter in a bid to escape," he said.
Sonowal, who is in Delhi, said the militants would be dealt with "very sternly", a statement from the CMO said.
"We will not tolerate any threat from any group. The government will not bow to any pressure while tackling terrorist groups," he said, adding all deputy commissioners and superintendents of police across the state have been directed to be on high alert following the attack and in view of the Independence Day.
He announced an ex-gratia payment of Rs 5 lakh to the next of kin of the dead, Rs one lakh to the seriously injured and Rs 20,000 to those who sustained minor injuries in the attack.
He said, "Peace had returned to the Bodoland area and this incident has given us shock. We will ensure that the victims families are taken care of".
Home Minister Rajnath Singh was briefed about the attack by National Security Advisor A K Doval.