By Sahra Abdi and Ibrahim Mohamed
MOGADISHU, Oct 18 - Residents fled the Islamist-held town of Afmadow in southern Somalia on Tuesday and al Qaeda-linked rebels rushed in reinforcements to hunker down for battle with advancing Kenyan and government troops.
Kenya launched an offensive with Somali forces on Sunday in a high-stakes bid to secure its porous border with its anarchic neighbor after a wave of kidnappings by gunmen thought to be linked to the rebels. The operation is a major escalation that risks dragging Kenya deeper into Somalia's two-decade civil war.
Warplanes swooped low over the rebel stronghold and a senior commander of a militia group allied to the Western-backed Somali government said his fighters were stationed about 12 km outside Afmadow as pounding rain slowed the advance.
"Most residents have been fleeing since yesterday toward Dhobley," Afmadow resident Hussein Osman Roble told Reuters by telephone, referring to the border area which Kenyan military sources say has now been cleared of militants.
"Jets have flown low over Afmadow, terrifying the residents, while al Shabaab is digging trenches and tunnels for defense inside and around Afmadow," Roble said.
It was not immediately possible to determine how far Kenyan and Somali government forces were from Afmadow. They had been reported passing through Qoqani, about 30 km to the west, on Monday. The rebels said Kenyan forces were 100 km (62 miles) inside Somali territory.
Al Shabaab, which is waging an insurgency to topple a government it sees as a puppet of the West, urged Somalis to pick up arms and threatened retaliation against Kenya for the military operation.
A Somali army general said rebels were holding two Spanish aid worker hostages, and had moved them north to their coastal stronghold Kismayu as Kenyan and Somali forces closed in.
"Al Shabaab is holding them in Kismayu," General Yusuf Hussein Dunmaal, who commands Somalia's southern forces, told Reuters by telephone.
The militants have denied responsibility for the kidnappings of the Spaniards, seized from a refugee camp in Kenya where they were assisting fleeing Somalis, or for two other kidnappings of Westerners in Kenya. They say the kidnappings are being used as a pretext to launch the cross-border operation.
"FLAMES OF WAR"
Al Shabaab threatened to take the "flames of war" back across the frontier if Kenya did not withdraw its troops.
"The Mujahideen and all Somalis should fight back (against the) Kenyan troops that have invaded us," a pro-Shabaab website quoted Sheikh Hassan Abdullahi Hirsi, a senior Al Shabaab official, as saying.
A senior commander in the Ras Kamboni militia that is nominally allied to the internationally backed government said their advance was being slowed by heavy rains.
"We are in the village of Cag Libaax, 12 km to the west of Afmadow. We are heading to Afmadow but we are slowed by rains and muddy soils," said Abdinasir Serar.
Al Shabaab has scrambled columns of fighters and dozens of battle-wagons mounted with heavy machine guns as remaining residents in Afmadow braced for fierce clashes.
Separately, Kenya arrested two British citizens suspected of ties to Somalia's al Qaeda-linked rebels as they crossed the border into the Horn of Africa country close to the coastline.
East Africa's biggest economy has long looked nervously at its anarchic neighbor and its troops have made brief incursions into Somali territory in the past. The latest incursion, on a larger scale, could invite reprisals.
"Al Shabaab has avoided attacks (inside Kenya) so far because it benefits too much from the illegal shipment of goods from Kismayu into Kenya and from financial supporters in the Somali community in Kenya," said David Shinn, a former U.S. ambassador to Ethiopia.
"Al Shabaab may conclude that the Kenyan action must be responded to, however, and the easiest way to do this is to carry out terrorist attacks inside Kenya. This would really ratchet up tension in the Horn," he said.
(Additional reporting by Abdi Sheikh in Mogadishu, Richard Lough and Beatrice Gachenge in Nairobi; Writing by Richard Lough; Editing by Yara Bayoumy and Peter Graff)