MOGADISHU, Somalia - Somalia's government says it is now willing to talk with the military wing of the country's Islamist movement.

The announcement by Prime Minister Nur Hassan Hussein represents a major change in government policy. It follows within days of the Islamic group having captured a town in southwestern Somalia.

The militants also briefly held another strategic central town last week.

The Islamists are attempting to regain territory lost in December 2006 in a U.S.-backed and Ethiopian-led offensive that put Hussein's government in power.

A spokesman for the Islamists could not be reached for comment and it is not known whether they have any interest in negotiations.

The Mogadishu government has in the past been willing to talk with members of the Islamist movement that it considers to be moderates, but not the movement's al-Shabab military wing, which Washington contends has links to al Qaeda.

But on Wednesday the prime minister told journalists "the government will meet its opponents, including al-Shabab group wherever and whenever they want."

President Abdullahi Yusuf supports the change in policy, the prime minister added.

When they were ousted in 2006, the fighters vowed to wage an Iraq-style war on the shaky transitional government.

Since they launched their insurgency in Mogadishu, thousands of Somalis have been killed. Somali troops and officials have come under almost daily attack.

While many Somalis did not support the more extreme religious laws enforced by the Islamists, the group did manage to gain the confidence of many by significantly reducing the street fighting between clans that have plagued the Horn of Africa country since dictator Mohamed Siad Barre was overthrown by a group of warlords in 1991.