Chad and Sudan have restored diplomatic relations, which Chad severed in the wake of an armed uprising in April.
The April uprising in Chad damaged relations with Sudan
The announcement came during a visit by Sudanese President Omar al-Bashir as Chadian President Idriss Deby was sworn in for a third term in office.
Mr Deby cut ties with Sudan after accusing it of backing rebels who attacked Chad's capital, N'Djamena.
He won elections in May, boycotted by the opposition who said he changed the constitution illegally to stand.
Libyan leader Col Muammar Gadaffi, who had helped encourage the two presidents to resume relations, attended the inauguration ceremony on Tuesday.
President Deby (r) has ruled Chad for 16 years
He took President Bashir by the hand and led him onto the stage to greet President Deby.
Mr Deby and President al-Bashir then shared a long embrace and the audience screamed with anticipation.
Col Gadaffi, clad in his trademark sunglasses, then lifted both men's hands up together as he gave a salute of peace.
A few hours later, Chad and Sudan announced they would resume diplomatic relations with immediate effect.
Their respective embassies will be opened once again later this year.
As President Deby prepares to begin his 16th year in power, the resumption of relations with Sudan is a very positive sign, the BBC's Stephanie Hancock in N'Djamena says.
In recent months hostilities on the Chad-Sudan border have threatened to destabilise the region of Central Africa, but the resumption of relations signals renewed hope for stability and peace.
Meanwhile, the United Nations has called for more police along the border, where it says the security situation is deteriorating.
The UN refugee agency (UNHCR) says it is getting more dangerous for aid workers to provide assistance to some 200,000 refugees who have fled fighting in Sudan's Darfur region.
Last Friday, seven men brandishing assault rifles and wearing military uniforms broke into the compound of a non-governmental organisation in Guereda, the UNHCR said in a statement on Tuesday
Three aid workers were hit in the head with rifle butts and the intruders stole money that was to be used to pay salaries and for the agency's work in refugee camps.
This is the seventh time humanitarian workers have been targeted in the Guereda area since May.