Russia has bombed, blockaded and plundered the grain production capacity of Ukraine, which accounts for one-tenth of global wheat exports, resulting in dire forecasts of increased hunger and of spiking food prices around the world.

Now, the United States has warned that the Kremlin is trying to profit from that plunder by selling stolen wheat to drought-stricken countries in Africa, some facing possible famine.

In mid-May, the United States sent an alert to 14 countries, mostly in Africa, that Russian cargo vessels were leaving ports near Ukraine laden with what a State Department cable described as “stolen Ukrainian grain.” The cable identified by name three Russian cargo vessels it said were suspected of transporting it.

The American alert about the grain has only sharpened the dilemma for African countries, many already feeling trapped between East and West, as they potentially face a hard choice between, on one hand, benefiting from possible war crimes and displeasing a powerful Western ally, and on the other, refusing cheap food at a time when wheat prices are soaring and hundreds of thousands of people are starving.

The alarm sounded by Washington reinforced Ukrainian government accusations that Russia has stolen up to 500,000 tons of Ukrainian wheat, worth $100 million, since Russia’s invasion in February. Much of it has been trucked to ports in Russia-controlled Crimea, then transferred to ships, including some under Western sanctions, Ukrainian officials say.

On Friday, the head of the African Union, President Macky Sall of Senegal, met in Russia with President Vladimir V. Putin, in an effort to secure grain supplies from the country.

Critics said the trip, during which Mr. Sall referred to his “dear friend Vladimir,” played straight into Mr. Putin’s hands by offering him yet another tool to leverage divisions in the international response to his brutal assault on Ukraine.

But many African nations are already ambivalent about the punishing Western campaign of sanctions against Russia for reasons that include their dependence on Russian arms sales, lingering Cold War-era sympathies and perceptions of Western double standards

Russia and Ukraine normally supply about 40 percent of wheat needs in Africa, where prices for the grain have risen 23 percent in the past year, the United Nations says. In the Horn of Africa region, a devastating drought has left 17 million people hungry, mostly in parts of Somalia, Ethiopia and Kenya, according to the United Nations. More than 200,000 people in Somalia are on the brink of famine.

Faced with such pressing need, many African countries are unlikely to hesitate before buying Russian-supplied grain, no matter where it comes from, said Hassan Khannenje, director of the HORN International Institute for Strategic Studies, a research body in Kenya.

“This is not a dilemma,” Mr. Khannenje said. “Africans don’t care where they get their food from, and if someone is going to moralize about that, they are mistaken.”

“The need for food is so severe,” he added, “that it’s not something they need to debate.”

Ukrainian officials said the solution to Africa’s food problem is greater global pressure to end the war, not purchases of looted grain. There is a “simple answer,” Taras Vysotsky, Ukraine’s deputy minister of agriculture, said: “Stop the fighting.”

Mr. Vysotsky and other Ukrainian ministers have been accusing Russia for months of stealing grain from the territories it occupies in the country’s southern breadbasket, described by one as “outright robbery.” Much of it has been taken from storage elevators in occupied parts of the Zaporizhzhia, Kherson, Donetsk and Luhansk regions, they say.

“There is nothing left to steal,” Mr. Vysotsky said in an interview.

The first reports of grain plunder emerged in mid-March. Commentators on Russian state TV stations have since openly boasted about the seizures, saying that Russia intends to continue with them.

The Russians also stole an estimated $15 million to $20 million worth of agricultural machinery, Mr. Vysotsky said.

Much of the looted grain, according Ukrainian officials, ends up at ports like Sevastopol on the Crimean peninsula, which Russia has occupied since 2014.