It threatened Security Council action against those who block peace efforts or attempt to overthrow the government, but no specific measures were mentioned.
Critics of the resolution, including some non-governmental organisations, accuse the Security Council of taking sides in supporting the transitional government.
The government was formed with the help of the UN two years ago but it has struggled to assert its authority against the Islamic Courts.
John Bolton, the US ambassador to the UN, said the US is concerned about the deteriorating security situation in Somalia and the possibility of a wider regional conflict, and views a regional force "as a key element in preventing conflict".
There are fears that Somalia could become a proxy battleground for Ethiopia and Eritrea, which fought a border war from 1998 to 2000.
A confidential UN report obtained recently by The Associated Press said 6,000 to 8,000 Ethiopian troops were in Somalia or along the border, supporting the transitional government.
It also said 2,000 soldiers from Eritrea were inside Somalia, supporting the Islamic Courts.
Eritrea denies this and Ethiopia says it has sent only a few hundred advisers to the country.
The Islamic courts said the resolution could push them into a war with interim government forces.
"We see the approval of the resolution as nothing but an evil intention," Abdirahin Ali Mudey, a spokesman for the Council of Islamic Courts, told the Associated Press.
|"The international community has proven to be biased and unjust"|
Abdirahin Ali Mudey, spokesman for the Council of Islamic Courts
He said the resolution would bring more sophisticated weapons into Somalia and he accused the Security Council of giving Ethiopia permission to occupy the country.
The Islamic courts said they will also reconsider attending peace talks which are scheduled for later this month.
"The international community has proven to be biased and unjust," he said.
"Protection and training"
The resolution authorises the seven-nation regional group, the Intergovernmental Authority on Development (IGAD), and members of the African Union to establish "a protection and training mission in Somalia" for an initial period of six months.
It lifts the 1992 arms embargo so the regional force can be supplied with weapons and military equipment.
The resolution bans Somalia's neighbours from sending soldiers. The ban would prohibit participation in the force by troops from Ethiopia, Djibouti and Kenya - but not Uganda, which is the only country to volunteer troops so far.
Council diplomats said IGAD envisions a force of eight battalions, each with 700 to 800 troops, but only two would be deployed in the first phase.
Bolton told the council that the US views the deployment of a regional force "as a critical element to help resume credible dialogue" between the transitional government and the Union of Islamic Courts.
He said: "It will also help to create the conditions for Ethiopian and Eritrean disengagement from Somalia."