His apology came a day after he sacked his son, Muhoozi Kainerugaba as commander of the army's land forces, BBC reports.
Uganda's President, Yoweri Museveni has sacked his son, Muhoozi Kainerugaba as commander of the army's land forces after he took to Twitter and threatened to invade Kenya.
Museveni also asked Kenyans for "forgiveness" after the shocking act by his son - a senior military officer, according to BBC.
His apology came a day after the threat.
Kainerugaba was removed from the position after he repeatedly threatened to invade neighbouring Kenya, via tweets shared on Monday, October 3.
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 two countries.
He then urged 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.
In an attempt at damage-control, President Museveni on Wednesday, October 5, 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," Museveni said.
President Museveni's son is known for his controversial tweets, including expressing support for Russia's invasion of Ukraine, and support of Tigrayan rebels fighting the Ethiopian government.
He also tweeted that he would give 100 cattle 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.