Dozens of foreign fighters have defected from the Al Qaeda-linked militant group in Somalia due to internal disputes, and many of those men have moved into Kenya, a security official said.

Since early last year Kenyan security officials have observed movements by people suspected of being part of al-Shabab in Somalia, said a senior police official who insisted on anonymity because he is not authorized to speak to the press.

Al-Shabab and other militants are under increased scrutiny in Kenya following the Sept. 21 grenade-and-gunfire attack on Nairobi's Westgate Mall, an attack that killed at least 67 people.

The trial of four suspects arrested in conjunction with the mall attack opened in a Nairobi court on Wednesday. Two prosecution witnesses described how the mall came under attack by four gunmen.

Infighting between al-Shabab leader Ahmed Abdi Godane and other top militant leaders who support the inclusion of foreign fighters in the group has left the foreigners being "mistreated and mistrusted," the official said.

The foreigners include recruits from Western countries and some information about their movement into Kenya was provided by security organs of their home countries, he said.

Al-Shabab boasts several dozen American and European members, mostly men of Somali heritage. Authorities worry the foreign fighters who fled Somalia will form their own groups to carry out attacks, the official said.

Matt Bryden, the former head of the United Nations Monitoring Group on Somalia and Eritrea and a top expert on al-Shabab, said the migration of foreign fighters into Kenya also includes Kenyan members of al-Hijra, a Kenyan cell of al-Shabab sympathizers or fighters that Godane trusts.

Although Kenya remains relatively accessible to jihadist groups, and is rich in potential targets for terrorist attacks, it is unlikely to serve as a base for such groups, Bryden said. He noted that some analysts believe al-Hijra may have played a role in the Westgate attack.

Even as that original crop of foreign fighters seems to be fleeing, other African recruits from countries like Tanzania and Uganda are heading to Somalia, said Musa Yego, the chief of criminal investigations in Kenya's Garissa Country, which borders Somalia.

Already this month police intercepted six men between the ages of 18 and 25 from Tanzania and Uganda headed for Somalia, said Yego.

"They had visas which showed they are on a business trip and on being interrogated they claimed they are heading to Somalia to invest there," Yego said. "We asked them on how they can head for a war zone to invest there. These are among many youths being recruited to join the militants there."

Kenyan authorities arrested 60 men from Kenya traveling to Somalia in 2013, he said.

Godane, al-Shabab's leader, has had a falling out with several formerly influential al-Shabab leaders. Four militant commanders were killed in June, including two co-founders of the group, while its spiritual guide, Sheikh Hassan Dahir Aweys, fled for his life and was captured by Somali forces who are holding him in Mogadishu.

Last year, an American who joined al-Shabab, Alabama native Omar Hammami, was ambushed and killed by rivals. Hammami had used Twitter to accuse Godane of being a dictator.

Godane, though, appears to be in firm control. It was Godane who announced in 2012 that al-Shabab was allying itself with Al Qaeda.