Four people were killed in Kenya Thursday after Islamic extremists opened fire on a convoy of bus passengers, officials say.

Al-Shabab, a jihadist group based in neighboring Somalia with links to Al Qaeda, claimed responsibility for the attack on its Andalus radio station.

A man looks at a bus which was ambushed by gunmen in the Nyongoro area of Lamu county, near the Indian Ocean coast of Kenya Thursday, Jan. 2, 2020. (AP)

The gunmen fired at a convoy of three buses and two vans that were being escorted by police to Lamu, said Lamu County Commissioner Irungu Macharia. The four were killed when the vehicles were shot by attackers in an area along the eastern coast, Macharia said.

The first bus was hit with bullets on its side and tires. Other vehicles in the convoy stopped and the gunmen opened fire at passengers fleeing on foot into the bushes.

The police escort had been delayed and was behind the convoy but arrived in time to prevent a massacre, Macharia said.

When the extremists opened fire three passengers were shot at close range and died instantly, police said. The fourth fatality was a conductor of one of the buses. Two other passengers were wounded.

Mombasa County Governor Ali Hassan Joho condemned the attack in a tweet, calling it “unacceptable.”

Somalia's Al-Shabab rebels have stepped up attacks in Kenya in recent weeks. The group has vowed retribution for Kenya sending its troops to Somalia to fight the extremists.

Security analyst Andrew Franklin said the Kenyan government is not adequately addressing the rising security threat.

"There is low-intensity conflict going on and they (government officials) are not treating the situation in the five front-line counties with the seriousness it deserves," he said, referring to the counties that border Somalia.

Franklin said the Kenyan government does not have the resources in place to rapidly respond to ambushes. Police are not properly equipped and trained and the vehicles they use are not appropriate for use in rural areas, he said. Nor do police have enough personnel to respond effectively, he said.

US LAUNCHES DRONE STRIKES IN SOMALIA AFTER DEADLY CAR BOMBING

Al-Shabab stepped attacks in Kenya in December. The group killed 11 people in Mandera county who were pulled from a bus on December 6. The group killed two non-Muslim construction workers in Garissa county on December 17 and on Dec. 22 burned construction equipment owned by a Muslim contractor that was being used to develop a road in Mandera.

CLICK HERE TO GET THE FOX NEWS APP

"It flies in the face of what the government is saying, which is that things are getting better or that al-Shabab is a ragtag militia on its back-foot."

The Associated Press contributed to this report.