The shooting spree happened late on Saturday in Siakago, 90 miles north-east of the capital, Nairobi.
The suspect, who is in his 30s, went out Saturday night looking for a female friend but couldn't find her, said John Chelimo, the district commissioner. The officer is in police custody, he said.
Provincial Police Chief Marcus Ochola said ten people had been killed.
"The man is said to be accusing the girl of having infected him with HIV and when he went to look for her he did not find her," Ochola said. "That for now seems to be the motive behind the killings."
The shootings took place in three different bars, said Mr Chelimo.
"When gunshots were heard, two administration policemen ran towards him," he said. "They called his name but he did not even answer, he just shot at the two administration policemen on the spot, plus other gentlemen who met him - in total two ladies and eight men."
Many people didn't realise what was happening because they mistook the gunfire for fireworks, said Antonin Newite, a local radio reporter. Many Hindus in Kenya were celebrating the festival of Diwali on Saturday.
The killings sparked a mass protest in front of the Siakago police station yesterday, said Nyaga Manunga, whose daughter was one of those killed. He said the shootings took place very close to the police station.
"In Siakago there is no security," Manunga said. "Someone can't just shoot 20 to 30 bullets without any reaction from the police."
"Residents on the ground are very angry. They see us as people who kill rather than people who protect them," Marcus Ocholla, the provincial police officer for the eastern province said.