Uganda's President Yoweri Museveni has asked Kenyans for "forgiveness" after his son - a senior military officer - tweeted about invading their country.
His apology came a day after he sacked Muhoozi Kainerugaba as commander of the army's land forces.
But Mr Museveni softened the blow by promoting him to the rank of general, and retaining him as his adviser.
Mr Museveni has long been suspected of grooming the 48 year old to succeed him when he eventually steps down.
Gen Kainerugaba has increasingly been entering the political arena, with his critics saying this was in breach of the military's code of discipline.
His latest intervention came on Monday when he sent out a series of tweets - some serious, some in jest - about Kenya.
He said he had spoken to Kenya's former President Uhuru Kenyatta, and expressed regret that he had stepped down at the end of his two terms in August.
"My only problem with my beloved big brother is that he didn't stand for a third term. We would have won easily!" Gen Kainerugaba said.
In a later tweet to his more than 600,000 followers, he said: "It wouldn't take us, my army and me, 2 weeks to capture [Kenya's capital] Nairobi.
This led to an uproar on Twitter, with people accusing Gen Kainerugaba of being "reckless" and jeopardising relations between the neighbouring states.
It led to him urging Kenyans to "relax".
"I would never beat up the Kenyan army because my father told me never to attempt it! So our people in Kenya should relax!" Gen Kainerugaba tweeted.
Although the Kenyan government did not comment, Uganda's foreign ministry issued a statement saying Uganda treasured its "strong bilateral relations" with it "brotherly neighbour".
In the latest attempt at damage-control, Mr Museveni said he had spoken to Kenya's President William Ruto, and he was "very sorry" about his son's tweets.
"I ask our Kenyan brothers and sisters to forgive us for tweets sent by General Muhoozi, former Commander of Land Forces here, regarding the election matters in that great country.
"It is not correct for Public officers, be they civilian or military, to comment or interfere in any way, in the internal affairs of brother countries," Mr Museveni said.
He added that despite his son's "mistake", he had promoted him to the rank of full general because he could still make "many positive contributions".
"I know for a fact that General Muhoozi is a passionate Pan-Africanist," Mr Museveni said.
His son is known for his controversial tweets, including expressing support for Russia's invasion of Ukraine, and Tigrayan rebels fighting the Ethiopian government.
He also tweeted that he would give 100 cattle - apparently as a bride price - to Italy's incoming far-right Prime Minister Giorgia Meloni for being "fearless and true".
"I know Europeans give girls they like flowers? I have never understood it. In our culture you give a girl you like a cow," he added.