MOMBASA, Kenya - Kenyan soldiers shot dead six suspected members of a separatist group who hacked an officer to death in an attack on barracks in the port city of Mombasa, police and military officials said on Sunday.

The gang of between 15 and 20 men were dressed in black, wore red and blue ribbons around their heads and legs, and all had long beards and shaved heads, the port city's County Commissioner, Nelson Marwa, told reporters. They were carrying knives, machetes and improvised explosive devices and were thought to be members of the outlawed Mombasa Republican Council, which wants independence for Kenya's Indian Ocean coastal regions, Marwa said.

"In the wee hours of today as it was heavily raining, a gang attempted to raid the 17 Kenya Rifles barracks in Nyali, but were met with fierce fire. In the process six of them were gunned down, and several escaped with gun shots," he said. "These were guys who were out to engage in war.

We are holding one suspect who was arrested," Marwa said.

One officer who was involved in the fighting and did not wish to be named said a colleague had been hacked to death. "They cut one of my colleagues with machetes and killed him and that is why we responded fiercely killing many of them," he told Reuters.

MRC secretary general, Randu Nzai Ruwa, denied that the group had been involved in the attack. Authorities have accused the MRC of involvement in a spate of killings in 2012 and 2013, including attacks on the eve of the presidential elections when at least 15 people were killed. The group also denies involvement in any of those attacks.

Colonel David Obonyo, Kenya Defence Forces spokesman, said five of the attackers in the Mombasa incident were killed on the spot and a sixth was killed while trying to escape. Most attacks in recent years along Kenya's coast have been claimed by the Somali Islamist group al Shabaab, including the killing of at least 65 people in Lamu in June and July. Insecurity plagues the east African country and in the last few days there have been several attacks on security personnel. The Interior Ministry confirmed on Sunday that 20 police officers and two police reservists were killed in an ambush by in Turkana county in the northwest of Kenya early on Saturday.