NAIROBI, Kenya -- Six U.S. airstrikes that killed more than 60 people in a coastal Somali town were pre-emptive strikes to prevent a major extremist attack, according to a Somali intelligence officer.

The U.S. military said Monday it carried out four strikes on Dec. 15 in which 34 people were killed and two more on Dec. 16 which killed 28. The air attacks targeted Gandarshe, south of the capital, Mogadishu, it said.

No civilians were injured or killed in the attacks, it said.

The strikes were carried out in close co-ordination with Somalia's government and were "conducted to prevent al-Shabab from using remote areas as a safe haven to plot, direct, inspire, and recruit for future attacks," said the U.S. military statement.

The U.S. airstrikes were aimed at al-Shabab fighters who were preparing a major attack on a Somali government military base in the Lower Shabelle region, said a Somali intelligence official, who insisted on anonymity because he was not authorized to speak to the press.

"The strike has neutralized an imminent attack," he said. The airstrikes hit both a military camp and battle vehicles in Gandarshe, the official told The Associated Press.

Al-Shabab has long used historic Gandarshe town, roughly 48 kilometres (30 miles) southwest of Mogadishu, as a launching pad from for attacks, including car bombs that hit the capital.

Al-Shabab uses parts of southern and central Somalia to plot and direct extremist attacks, steal humanitarian aid, extort the local populace to fund its operations, and shelter radicals, said U.S. military statement.

With these attacks, the U.S. military has carried out at least 46 airstrikes so far this year against al-Shabab, which is allied to al-Qaida and Africa's most active Islamic extremist group. Al Shabab, which is fighting to establish its version of Shariah law in Somalia, controls parts of rural southern and central Somalia and continues to stage deadly attacks in Mogadishu and other cities.

The U.S. airstrikes have picked up dramatically since President Donald Trump took office and approved expanded military operations in the Horn of Africa nation. Airstrikes also target a small presence of fighters linked to the Islamic State group. The U.S. has about 500 military personnel in Somalia and earlier this month opened a permanent diplomatic presence in Mogadishu.

Several years ago, al-Shabab controlled large swathes of Somalia, including much of the capital city. The African Union forces succeeded in pushing the extremists from Mogadishu and most other major cities. However, al-Shabab continues to be active in Somalia's rural areas and launches suicide car bomb attacks in the capital. In October last year, a massive truck bomb killed more than 500 people.