By Ed Cropley

PRETORIA (Reuters) - Uganda feels "gutted" and "betrayed" by a U.N. report saying it is helping rebels in eastern Congo and will pull its troops out of peace-keeping operations in Somalia unless the allegations are withdrawn, its junior foreign minister said on Friday.

Speaking four days after a senior U.S. official said she expected Kampala would keep its forces in the war-torn Horn of Africa nation, Minister of State for Foreign Affairs Okello Oryem was adamant his government had not softened its stance.

"We will withdraw. There's no question about it. Let us be very clear about it," he told Reuters in Pretoria after a meeting with his South African counterpart. "I keep telling people: Do not take Uganda for granted."

Uganda's government said a week ago it would pull out of peacekeeping missions in Africa unless the United Nations amends an experts' report accusing it of supporting rebels in the neighboring Democratic Republic of Congo.

Ugandan soldiers account for more than a third of the 17,600 U.N.-mandated African peacekeepers battling al Qaeda-linked al Shabaab militants in Somalia.

A sudden reduction in troop numbers, especially in Mogadishu, would risk undoing security gains that allowed the first presidential elections in decades to be held in the Somali capital in September.

Uganda and its neighbor, Rwanda, have denied accusations in a leaked report by a U.N. Group of Experts that they are backing eastern Congo's so-called M23 rebels, led by Bosco Ntaganda, a war-lord nicknamed "The Terminator" who has been indicted on war crimes charges by the International Criminal Court in the Hague.

Oryem said the allegations were particularly hard to swallow given the recent advances of the U.N.-backed African Union force in Somalia and Kampala's support for a massive U.N. peacekeeping operation in eastern Congo.

"After all this achievement, the U.N. should be applauding us for doing their job for them instead of stabbing us in the back," he said. "We feel betrayed."

U.S. Undersecretary of State Wendy Sherman met Ugandan President Yoweri Museveni earlier this month, and even though he expressed concerns about the leaked report findings, she told reporters she still expected him to keep troops in Somalia.

Oryem also denied a U.N. suggestion that it had not been contacted directly, saying Secretary-General Ban Ki-moon had been given a formal letter laying out Kampala's position "in no uncertain terms".

(Reporting by Ed Cropley; Editing by Pascal Fletcher)