Abdirizak Adam, the chief of staff of the interim president Abdullahi Yusuf, made the announcement on Tuesday.
“We will go to Khartoum without any preconditions,” Adam said.
He was speaking after Francois Lonseny Fall, the UN special envoy, met Yusuf in his base in the provincial town of Baidoa and asked the government to attend talks in the Sudanese capital on August 1 and 2.
It was not immediately known if the Islamists would also agree to attend.
Talks to prevent a standoff between the two sides from escalating into war broke down on July 22, when the Islamists pulled out because of a reported incursion into Somalia by Ethiopian troops to defend the fragile interim government.
Fall’s visit came a day after the African Union (AU) urged the UN Security Council to speed up plans to ease an arms embargo on Somalia to allow foreign peacekeepers to deploy.
The appeal followed an agreement by the AU and the east African regional body IGAD to send troops to help to secure peace in Somalia.
The plan has been repeatedly rejected by the Islamists, who control Mogadishu and a large swath of southern Somalia after defeating US-backed secular regional chiefs early last month.