* Attackers shout "God is greatest" as shoot worshippers
* Islamist sect Boko Haram active in Kano
* Police decline to speculate on who behind attack
By Ibrahim Shuaibu
KANO, Nigeria, Jan 8 (Reuters) - Gunmen opened fire on worshippers at a mosque near northern Nigeria's main city of Kano, killing three of them and wounding 12 as they prayed, witnesses and police said on Wednesday.
Islamist insurgent group Boko Haram is active in Kano, Nigeria's second biggest city and relic of a medieval Islamic empire that thrived for centuries on trade routes crossing the Sahara to the Mediterranean coast.
The militants see anyone who does not follow their austere brand of Islam as apostates and have assassinated Muslim clerics who oppose them. They often target the security forces or Christians, but they have attacked mosques in the past.
Police spokesman Musa Majiya declined to speculate on who was behind Tuesday night's attack in Kwankwaso village, about 30 km from Kano and home of Kano state governor Rabi'u Musa Kwankwaso. Criminal gangs also operate in the area.
"We were inside the mosque praying when we heard gunshots just as we were almost finishing the prayer," witness Adamu Inuwa said, speaking by telephone from a hospital bed where he was nursing a gunshot wound.
"It was terrible. They were shouting 'Allah akbar' (God is Greatest) and shooting sporadically everywhere. I escaped through the fence."
Boko Haram has fought for the past four years to carve a breakaway Islamist state out of majority Muslim northern Nigeria, and is now the gravest security threat to Africa's top energy producer.
They have killed thousands since launching an uprising in 2009 - the vast majority Muslims - and an offensive President Goodluck Jonathan ordered in May last year has so far failed to quell them.
But there is also a patchwork of criminal gangs loosely associated with the rebels who take advantage of northern Nigeria's security vacuum to rob and kill.
Some are connected to local politicians.
"I don't know why Boko Haram would attack the hometown of the state governor," said the governor's special assistant Suleiman Iliya, pointing out that the governor defected to the opposition last month. "I think maybe the attack was political."
Political violence is expected to increase this year, ahead of closely fought presidential and regional elections in 2015. (Writing by Tim Cocks; Editing by Joe Brock and Alison Williams)