Louis Michel, the EU humanitarian envoy, said the Islamic Courts had "accepted to engage in political dialogue with the transitional government."
Somali government officials said they would also attend talks in Khartoum, Sudan but no date was given.
Leaders of the Islamic Courts said they were willing to attend without conditions.
The movement had previously said it would not attend talks until Ethiopian troops backing the government withdrew from the country.
As he left the Somali capital Mogadishu after a day of negotiaitions, Michel said: "For me this is very significant."
Fighting played down
Sheik Hassan Dahir Aweys, the Islamic Courts, played down the fighting that had erupted earlier in the day.
He said: "This was not full scale war. The fighting was a small incident between the Islamic courts and the Ethiopians, not between us and the government."
Somali fighters clashed with artillery, rocket-propelled grenades and anti-aircraft guns as Michel negotiated with the government and the Islamic movement to talk peace.
Clashes first erupted 15km from the government garrison town of Baidoa where Michel was meeting with Ali Mohamed Gedi, the Somali prime minister and Abdullahi Yusuf, the president.
The fighting took place just a day after an ultimatum by the Islamic Courts for Ethiopian troops backing the transitional government to leave or face a major attack.
Al Jazeera said the Islamic Courts had denied reports from Baidoa claiming hundreds of its fighters were killed in heavy fighting there.
Late on Tuesday, government troops and Islamic fighters also clashed near Idale, another front-line village northwest of Mogadishu, spokesmen from both sides said. Ten people were killed.
Fears of a full-blown civil war have intensified in recent weeks as the government and the Islamic Courts dismissed efforts to schedule peace talks and threatened military action.