Flames rise from Saudi Arabia's embassy after it was stormed by Iranian protesters during a demonstration in Tehran, Iran, Jan. 2, 2016. Reuters

When President Barack Obama moves on from the White House in January, he will leave in place a precarious power struggle between Saudi Arabia and Iran after years of revamping Washington's approach to the region. Then it will be Donald Trump's turn to weigh in, and Tehran may have found themselves an unlikely ally in the Republican businessman who threatens to upset the entire outlook of U.S. foreign policy in the Middle East.

Obama's administration, while critical at times of the kingdom, supported Saudi Arabia in its political endeavors across the Middle East, often at the expense of Iran. The administration's landmark multilateral nuclear treaty with Tehran, however, saw unprecedented levels of negotiation between Western and Iranian officials and lifted years-long economic sanctions against Iran.

The president-elect is expected to scale back U.S. intervention in the Middle East. While there is not likely to be a warming of U.S.-Iranian relations under a Trump administration, Washington's absence could work in Tehran’s favor, emboldening efforts to expand its already growing sphere of influence without fear of U.S. reprisal and with potential sponsorship by Russia.

Sunni Muslim-majority Saudi Arabia and Shiite Muslim-majority Iran have long been locked in what analysts have referred to as "a regional cold war." The rival powers have not engaged in direct military conflict, but back opposing military and political movements. In the Syrian Civil War, Iran supports Syrian President Bashar Assad against a network of rebel groups sponsored by the West, Turkey and Gulf states such as Saudi Arabia. In Iraq, Shiite militias and an Iran-friendly government in Baghdad also add to Riyadh's worries over Tehran's influence. Meanwhile, Saudi Arabia is directly involved in a massive military campaign in Yemen against Houthi rebels, who represent the country's Zaidi Shiite minority and receive political and possibly military support from Iran.

The Obama administration often censured Tehran-aligned movements while supporting allies of Riyadh. On the diplomatic level, Obama fought diligently for the historic Iran nuclear deal known as the Joint Comprehensive Plan of Action, or JCPOA, and eventually managed to get Iran and five other countries on board with it.

Trump used the deal as fuel for his campaign, during which he took a particularly tough stance against Iran and for which he was lauded by conservatives. He vowed to tear up the nuclear treaty and threatened to shoot Iranian ships out of the water if they provoked the U.S. Navy.

Trump also went after Saudi Arabia, leading experts to question the depth of his support for the traditional U.S. ally.

“Actually, everything about Trump’s foreign policy is in doubt. He said something totally contradictory on his campaign. On one hand he attacked the JCPOA, but on the other hand, he also criticized the U.S. relationship with Saudi Arabia,” Iranian journalist and Middle East analyst Saeid Jafari told International Business Times in an email.

Trump has criticized Saudi Arabia and other Gulf Cooperation Council countries for getting rich off of their vast oil deposits and benefiting from U.S. security pledges without ample compensation. Riyadh's oil minister Khalid al-Falih responded last week to Trump's repeated calls to make the U.S. energy independent by stating that Trump would "see the benefits" of maintaining Saudi oil imports and the industry would advise him "that blocking trade in any product is not healthy." Trump has also resorted to Twitter wars with billionaire Saudi Prince Waleed Bin Talal.

More concerning to Saudis than social media squabbles is how a Trump administration plans on handling Iran and its proxy military and political forces in the region. The U.S. currently targets the Islamic State group in Syria, but supports Syrian rebel groups. Both entities oppose Assad. Riyadh had hoped a Hillary Clinton administration would have increased the U.S. military commitment to support the rebels in Syria and oppose rebels in Yemen.

Trump's victory appears to cast heavy doubt on the U.S. military's future role in the Middle East.

"Donald Trump does all kind of things that are completely the opposite of what we have seen from American politics and policy," said Kenneth M. Pollack, a senior fellow at the Brookings Institution's Center for Middle East Policy in Washington, D.C., said in a phone interview with IB Times.

“I think it’s clear that a Trump administration has no intention of going to war in Yemen, and has no intention of ramping up assistance to Saudi Arabia,” Pollack added.

Trump seemed to affirm this noninterventionist stance Tuesday when he told the New York Times, "I don't think we should be a nation-builder."

He has expressed his disdain for the beleaguered opposition groups of Syria, pointing out their ties to radical jihadist movements such as Jabhet Fatah al-Sham, formerly known as Al Qaeda's Al Nusra Front. The president-elect has not gone as far as to pledge support for Assad, but he has hinted at cooperation with his Russian counterpart Vladimir Putin, who backs the Syrian leader and whose forces in Syria regularly coordinate with Iran and its allies.

Gerald Feierstein, former U.S. ambassador to Yemen and principal deputy assistant secretary of state for near east affairs, said Trump’s ties to Russia will benefit Tehran's political ambitions.

"I speculate that, as president, Trump would like to minimize his engagement in the Middle East, except for the fight against ISIL and other violent extremist groups. If that were the case, it would strengthen Iran's hand in pursuing its efforts at regional hegemony, particularly if the fight against violent extremism includes enhanced cooperation with Russia, the Syrian regime and, by extension, Iran," Feierstein said, using an alternative for the Islamic State group, also known as ISIS.

The uncertainty of Trump's message, however, could also very well work in Saudi Arabia's favor instead. If next year's administration chooses to scrap the Iranian nuclear deal as a central goal, Tehran will likely find itself in Washington's crosshairs.

"The wild card is Trump's other stated preference to take a more confrontational stance against Iran itself both in terms of its nuclear aspirations as well as its malign efforts in the region. If that becomes a Trump administration policy choice, he would likely find a supportive environment in Saudi Arabia and the rest of the GCC," Feierstein said.

While Trump has not yet definitively chosen his cabinet, some rumored frontrunners, such as Sen. Tom Cotton of Arkansas, former Mayor of New York Rudolph Giuliani and former Sen. Jon Kyl of Arizona, have been extremely critical of Iran. Duncan Hunter, a Republican congressman from California and a potential pick for defense secretary, has even advocated for the use of “tactical nuclear weapons” against the country.

Michael Knights, military and security affairs expert at the Washington Institute for Near East Policy, an affiliate of the American Israeli Political Affairs Committee, said Trump’s administration will likely take an aggressive stance toward Iran.

"The Trump team will go for Iran very hard. Whether they like the Saudis or not, the Trump team and Riyadh will end up on the same side of the regional Cold War," Knights said. "The U.S. will return to a containment posture vis-à-vis Tehran, possibly even with punitive military pressure and covert exploration of regime change.”

Many experts say it’s too early to tell what Trump and his future administration are capable of. The contradicting statements made before and after his election have kept allies and enemies alike waiting for a clear sign of direction in next year’s U.S. foreign policy.

“It is really impossible to say. President-elect Trump has given numerous, and often contradictory signals on both Iran and the Saudi question. Only time will show if his election will have a profound impact on U.S. policy toward the Middle East,” said Alex Vatanka, a senior fellow at the Middle East Institute in Washington, D.C., who specializes in regional security affairs related to Iran.

“Nobody really knows the answer to this. I don't even think the president-elect knows the answer to this question,” he added.