Somalia's al Shabaab militant group attacked on Sunday a military base in Kenya used by both U.S. and Kenyan forces and published pictures of masked gunmen standing next to an aircraft in flames.

U.S. Africa Command confirmed an attack on the Manda Bay Airfield in Lamu county, which is close to the Somali border. The Kenyan military said the attack had been repelled and that four militants had been killed. There were no immediate reports of Kenyan or U.S. casualties.

An independent investigator matched the pictures published by the group with satellite imagery to an airfield just outside the base used by military aircraft. There was no indication the militants had managed to enter the base.

The attack that began before dawn lasted around four hours, witnesses and military sources told Reuters.

"Seven aircraft and three military vehicles were destroyed in the attack," al Shabaab said in a statement.

The al Qaeda-affiliated jihadist al Shabaab immediately claimed responsibility for the assault in Lamu county on Kenya's Indian Ocean coast, to Somalia.

Kenyan military spokesman Colonel Paul Njuguna said the base was now secure and that at least four militants were killed in the attack.

"This morning at around 5:30 am an attempt was made to breach security at Manda Air Strip. The attempted breach was successfully repulsed," he said.

"The airstrip is safe. Arising from the unsuccessful breach a fire broke out affecting some of the fuel tanks located at the airstrip. The fire has been put under control."

The airfield is separate to another on Manda Island used by commercial flights to Lamu.

Kenya sent troops into Somalia in 2011 after a spate of cross-border attacks and kidnappings. They were later absorbed into an African Union peacekeeping force, now 21,000-strong, that supports the shaky, Western-backed Somali government. Al Shabaab has been fighting for more than a decade to overthrow the government and impose strict Islamic law.

Benjamin Strick, who analyses satellite imagery for open source investigation websites like Bellingcat, said the al Shabaab photos matched satellite images of buildings and a distinctive aircraft apron adjacent to the base but outside its perimeter.