MOGADISHU (Reuters) - Gunmen from the Somali Islamist group al Shabaab killed at least eight officers in a raid on a police station near the capital, police and the militants said on Saturday.

Al Shabaab fighters at about 1am local time stormed a police station on the edge of Afgoi town, 30km southwest of Mogadishu, killing eight officers and stealing three pick up trucks, including one that had a machine gun mounted on it.

"Al Shabaab killed eight of my colleagues and took three of our cars last night," Major Abdikadir Hussein, a police officer told Reuters from Afgoi.

"We traced them this morning, killed 10 of them and secured our pick up car with a gun hooked on," he added, saying the Islamists ran off with the other two vehicles.

Al Shabaab, which wants to topple a Western-backed government in Mogadishu, has in the past stepped up the number of raids during the Muslim fasting month of Ramadan, which began on Wednesday.

The group's military operations spokesman, Sheikh Abdiasis Abu Musab, told Reuters his fighters had killed 12 officers in the raid on the Afgoi police station and lost one gunman in the second battle.

"This morning the police attacked us and after a fighting we burnt a police car. We left the pick-up car we had taken. One fighter martyred from our side," he said.

In the past, al Shabaab has exaggerated the number of soldiers it has killed, while officials have played down losses.

The latest assault highlights al Shabaab's ability to launch attacks even though it has lost territory and urban strongholds since a major military offensive against began last year.

(Reporting by Abdi Sheikh, Feisal Omar; Writing by Drazen Jorgic; Editing by Janet Lawrence and Mark Potter)