Senior Islamic Courts officials signed the deal with the group led by Sharif Hassan Sheik Aden, the parliament's speaker, in the capital, Mogadishu, on Friday.
The two sides said in a joint statement: "We have agreed to stop current hostilities and avoid any activities that would heighten tensions between the government and the Islamic Courts.
"We therefore agreed to continue the peace talks agreed by both sides to take place in the Sudanese capital Khartoum organised by the Arab League and the government of Sudan."
However, a spokesman for the interim government dismissed the deal.
Ali Ahmed Jama Jangali, the information minister, said, reading from a cabinet statement: "The cabinet sees the speaker's meeting with the Islamists as personal and one that is not representative of the government.
"The stated agreements are non-existent."
Peace talks collapsed on November 1 when the Islamic Courts refused to talk with the government until Ethiopia withdrew its troops from the country and Kenya was removed from its role as mediator.
Aden is considered the government member most sympathetic to the Islamic Courts. His decision to hold talks without involving the prime minister and president was seen as a direct challenge to their authority.
Omar Hashi, who signed the agreement on behalf of the parliamentary speaker, said: "We hope this agreement will prevent a conflict in Somalia."
"This is a first step, and we are headed for peace"
Ibrahim Hassan Adow, the Islamic courts spokesman for foreign affairs
The deal includes a pledge by both sides not to allow foreign interference in Somalia, and calls on other countries to maintain a UN arms embargo that prevents African peacekeepers from entering the country.
Ibrahim Hassan Adow, the Islamic Courts spokesman for foreign affairs, said: "This is a first step, and we are headed for peace."
Somali officials said Aden would present the proposal to the government in the town of Baidoa, but they have previously rejected his peace efforts as "futile".
Meanwhile, Abdullah Yusuf Ahmed, the Somali president, travelled to Sanaa to discuss the possibility of Yemen's involvement as a mediator.
After talking with Ali Abdullah Saleh, the Yemeni president, he said he would seize any opportunity to achieve peace with the Islamic Courts "provided they end their military operations".
There are fears Somalia could become a proxy battleground for neighbouring Ethiopia and Eritrea, who fought a border war between 1998 and 2000.
Eritrea supports the Islamic Courts, while Ethiopia backs the interim government.
A confidential UN report obtained recently by The Associated Press said that 6,000-8,000 Ethiopian troops were in Somalia or along the border. It also said 2,000 soldiers from Eritrea were in the country.
Eritrea denies having any troops in Somalia, while Ethiopia insists it has sent only a few hundred advisers.