KHARTOUM, Sudan — It was September 2008 and a band of Somali pirates made a startling discovery.

The Ukrainian freighter they had just commandeered in the Gulf of Aden was packed with weapons, including 32 Soviet-era battle tanks, and the entire arsenal was headed for the regional government in southern Sudan. The Ukrainian and Kenyan governments vigorously denied that, insisting that the tanks were intended for the Kenyan military.

“This is a big loss for us,” said Alfred Mutua, a spokesman for the Kenyan government, at the time.

But it turns out the pirates were telling the truth — and the Kenyans and Ukrainians were not, at least publicly. According to several secret State Department cables made public by WikiLeaks, the tanks not only were headed to southern Sudan, but they were the latest installment of several underground arms shipments. By the time the freighter was seized, 67 T-72 tanks had already been delivered to bolster southern Sudan’s armed forces against the government in Khartoum, an international pariah for its human rights abuses in Darfur.

Bush administration officials knew of the earlier weapons transactions and chose not to shut them down, an official from southern Sudan asserted in an interview, and the cables acknowledge the Kenyan officials’ assertions that they had kept American officials informed about the deal. But once the pirates exposed the arms pipeline through Kenya, the Obama administration protested to the Ukrainian and Kenyan governments, even threatening sanctions, the cables show.

Vann H. Van Diepen, a senior State Department official, presented the Ukrainians with a sales contract that showed southern Sudan as the recipient, according to a November 2009 cable from the American Embassy in Kiev. When they dismissed it as a forgery, Mr. Van Diepen “showed the Ukrainians cleared satellite imagery of T-72 tanks unloaded in Kenya, transferred to railyards for onward shipment, and finally in South Sudan,” the cable said, referring to the early deliveries of the weapons. “This led to a commotion on the Ukrainian side.”