Until the handshake between President Uhuru Kenyatta and Opposition leader Raila Odinga early last year, Kenya had endured a very cold bilateral relationship with Tanzania since 2015 when President John Pombe Magufuli was elected to office.
Multiple sources familiar with the push to get the two heads of state into talking terms say it took the intervention of Mr Odinga to break the ice.
"A day before President Kenyatta went to Dar, Raila talked with Magufuli about the visit on phone. Again, after the President inspected ongoing works at the Kisumu port, Raila had passed by Dar," a close associate of one of the two leading politicians told Nation on Saturday.
The deal was largely brokered through phone calls, sometimes when Mr Kenyatta and Mr Odinga were together or when the opposition chief was in Tanzania.
A source said there has also been a physical engagement among the three away from the public.
President Kenyatta is said to have been concerned about dwindling trade between the two neighbours affecting the export market largely caused by the hostile environment.
And when Mr Kenyatta visited Tanzania on July 5 in show of a thaw in their engagement, he was hosted at the rural home of Dr Magufuli. It would appear that the relationship has normalised.
"The President of Kenya, Uhuru Kenyatta, will arrive in the country on Friday at 10am at Chato Airport. He will then proceed to President Magufuli's home in Mlimani Chato District," a statement from State House, Dar es Salaam, said.
While there, Mr Kenyatta offered a moving prayer for the ailing mother of Dr Magufuli, exciting many of his supporters.
The bad blood between the two started when President Kenyatta's government appeared to support his opponent, former Prime Minister Edward Lowassa, with reports that the regime may have offered both technical and financial support in his campaigns.
In reciprocation, Mr Lowassa would endorse Mr Kenyatta for a second term in office ahead of the 2017 polls urging members of his Maasai tribe who are spread across the borders of the two countries to vote in the Jubilee government.
"Chadema Party agreed to support President Kenyatta's re-election because he has led Kenya well," Mr Lowassa said. A livid Dr Magufuli, who felt that Nairobi was interfering with its internal affairs, was not going to take this lightly.
He is said to have also thrown his weight behind Mr Odinga is the 2017 elections just to get back at the Jubilee administration.
And so when Mr Odinga agreed to work with President Kenyatta, reuniting Kenya and Tanzania became one of his immediate assignments. His handlers told Nation that he agreed to take up the task.
Before then, chicks imported from Kenya were burnt across the border and cows auctioned.
Dr Magufuli gave Mr Kenyatta's inauguration on November 28, 2017 a wide berth despite a tradition of neighbouring heads of state attending such fetes in the East African Community.
One of the pressing issues Kenya needs the support of Dar is the territorial dispute with Somalia which is pending in court.
Since Tanzania too shares a coastline with Somalia, Nairobi is keen to have the two adopt a common approach on the issue.
There are also issues touching on family business Mr Kenyatta is believed to have gone to unlock.
The newfound friendship was firmed up on Thursday when Kenya returned stolen gold to Tanzania with Foreign Affairs Cabinet Secretary Monica Juma leading a powerful delegation that included the Director of Public Prosecutions, Attorney General and the Directorate of Criminal Investigations boss.
They returned more than Sh15 million in cash recovered from a suspect. The package included gold worth about Sh168 million confiscated in February 2018 at the Jomo Kenyatta International Airport.
"I want to thank you for receiving the items and we will always work together to ensure that any stolen property from your country is brought back to benefit our citizens. We have a choice of choosing friends, but we have no option on the neighbours we choose," Mr Kenyatta said in a phone conference broadcasted by his counterpart to the audience.
Commitment. Dr Magufuli, in a demonstration of a restored bilateral engagement, said he would push for closer working relations between them.
The bromance saw Starehe MP Charles Njagua swiftly dealt with following his remarks calling for the deportation of foreigners, including Tanzanians who are doing business in Gikomba.
He has since been charged in court. His sentiments invited uproar in the Tanzanian parliament with some MPs calling for the deportation of businessmen from Kenya.
Mr Kenyatta would later visit the country to calm the tension, asking them to ignore statements by 'mad men'.