The world’s newest country, South Sudan, is trapped in a bloody civil war as rival political factions fight for control of the country’s oil reserves — the third biggest in sub-Saharan Africa. More than a thousand have died, and another 180,000 are refugees from the bloodbath, which, despite UN and US intervention and the opening of peace talks, shows no signs of slowing.

Sadly, this tragedy could have been avoided if the Obama White House had followed a more sensible policy in that strife-torn region. Instead, it’s relied on our former ambassador to the UN, new National Security Adviser Susan Rice, who for almost three decades has been a leading architect of this country’s policy toward Africa — with disastrous results.

Rice’s string of bad calls began when she was a 28-year-old consultant on President Bill Clinton’s National Security Council and advised him to take a hands-off approach to the massacres taking place in Rwanda in 1994 and not denounce it as genocide — an act of omission that still stands as Clinton’ greatest shame.

In 1998, she tried to end a civil war in Sierra Leone by forcing the government to grant amnesty to the child-murdering thugs of the Revolutionary United Front, or RUF, and make their leader head honcho of the country’s diamond trade. Three months later, Sierra Leone exploded as the RUF took 500 UN peacekeepers hostage; British troops had to go in to impose order.

But Sudan has been the centerpiece of Rice’s misshaping of America’s policy in Africa, and the current mess in South Sudan arises from two fatal errors.

The first is Rice’s leftist attraction for anyone who dubs himself a Marxist revolutionary or heads a People’s Liberation Army. In this case, it was the Sudan People’s Liberation Army with whose leaders Rice developed a close –some say overly close — relationship when she served in the Clinton administration. Even when she was out of office during the George W. Bush years, she lobbied hard for the SPLA’s goal of breaking free of the Sudanese government in Khartoum, and gaining independence for South Sudan.

But the sad truth is there’s nothing to hold South Sudan’s ethnically and religiously divided semi-nomads together except those oil reserves, which represent 98 percent of the country’s revenues. Without cash flowing to the new government to ease tensions, it was inevitable that those divisions would flare up into civil war among the SPLA’s gun-toting guerrillas.

And here Rice and the Obama team made their second mistake.

As soon as independence was granted in 2011, it was imperative to get Khartoum’s cooperation in negotiating borders, water rights and, above all, a lasting agreement on pumping South Sudan’s oil through Sudanese territory so it could get to market.

But Team Obama never did. Instead, they’ve insisted that the Khartoum regime remain a pariah state until Sudan’s rulers are punished for their transgressions against the South Sudanese people and the inhabitants of Darfur far to the northeast. The one State Department official who urged a “reset” in relations with Khartoum in order to help South Sudan’s transition, Special Envoy Scott Gration, got the boot.

So with the oil issue left unresolved, relations between Sudan and South Sudan have now collapsed. Last June, Sudan’s president shut down the oil pipeline, and then in December the rivalry between the SPLA’s top two leaders (members of rival ethnic groups, the Nuer and Dinka) exploded in open warfare. Now the US is stuck with Obama’s public commitment to help end the fighting — and with Susan Rice’s one-woman experiment in state building.

What’s the answer?

First, Washington must reopen communication channels with Khartoum, in order to negotiate a comprehensive settlement that will not only secure South Sudan’s future but also point the way to a lasting peace in Darfur.

Second, Susan Rice must leave the administration before she does more harm — not just in South Sudan but in the next items on her agenda as National Security Advisor, Iran, as well as the Israel-Palestinian peace process.

She’s led American policy into a series of disasters. South Sudan needs to be the last.

Arthur Herman, a historian, writes frequently on foreign policy for Commentary and The Post.