2016 was not a good year for Saudi Arabia.

Sharply lower oil prices sparked a domestic financial crisis that is forcing the country to restructure its economy.

Saudi Arabia’s bitter struggle with Iran for regional hegemony has embroiled it in wars and political conflicts it has been unable to win, leaving it no alternative but to admit failure or compromise.

If 2016 was bad, 2017 threatens to be worse.

Saudi Arabia closed out 2016 with a ceasefire in Syria and prospects for peace talks orchestrated by Russia and Turkey that significantly weakened Saudi-backed rebel groups and strengthened Iran’s key Middle East ally, Syrian president Bashar al-Assad. Saudi Arabia’s only hope of influencing events in Syria is if either the rebels, jihadists who are not part of the ceasefire, or Mr. Al-Assad sabotage it for their own reasons. But even then, the fall of Aleppo, the rebel’s last major urban holdout, threatens to reduce the anti-Assad resistance to a largely rural insurgency.

Adding insult to injury, Saudi Arabia, unable to block a candidate from becoming president of Lebanon who was supported by Hezbollah, the Lebanese Shiite militia that helped Mr. Al-Assad regain the upper hand in the Syrian civil war, was forced to strike a deal. It tacitly agreed to the appointment of Michel Aoun, a close Hezbollah ally, and quickly invited him to visit the kingdom early in the new year.

Mr. Aoun, as part of the deal, appointed Saad Hariri, the son of Rafik Hariri, the prime minister and Lebanese-Saudi businessman who was murdered in 2005 allegedly by Hezbollah operatives, as his head of government. Mr. Hariri, whose family conglomerate in the kingdom was hit badly by the financial crisis and needed to be bailed out, is beholden to the Saudi government. The deal ended a more than two-year long standoff between Iranian and Saudi-backed forces that left the presidency vacant.

Sensitive to any challenge to its custodianship of Islam’s two holiest cities, Mecca and Medina, Saudi Arabia’s role is in the spotlight as it negotiates modalities with some 80 countries for the 2017 haj. Saudi Arabia and Iran failed to reach an agreement for the 2016 pilgrimage, leaving the Islamic republic without a quote for pilgrims and the kingdom’s management of the haj challenged.

An almost two-year long military campaign in Yemen, that was supposed to be cakewalk has turned into a quagmire for the kingdom. Saudi Arabia is looking for a face-saving exit strategy from a neighbour that its military has devastated without removing its enemies, the Iranian-backed Houthis and former president Ali Abdullah Saleh, from power in much of the country, including the capital Sana’a. The campaign has sparked widespread anti-Saudi sentiment among significant numbers of Yemenis.

The campaign has moreover cast a shadow over the capabilities of a country that ranks as the world’s second largest importer of military equipment. The United States late last year halted the sale of air-dropped and precision-guided munitions until it has better trained Saudi forces in their targeting and use of the weapons. The Saudi air force’s repeated targeting by design or default of civilian targets in Yemen in which large numbers of innocent people were killed has opened the kingdom to assertions of war crimes.

Saudi Arabia’s inability to claim either political or military benefit from the Yemen war threatens to put on the line the credibility of Deputy Crown Prince Mohammed bin Sultan, the powerful son of King Salman, who is also in charge of turning the kingdom’s economy around. Many believe that King Salman is grooming Prince Mohammed as his successor despite objections from factions within the Al Saud family.

Similarly, Saudi Arabia’s use of its political and financial muscle to bring Egyptian-general-turned president Abdel Fattah Al-Sisi to power in a military coup in 2013 and stabilize Egypt’s deteriorating economy has failed to achieve a return. Instead, Saudi Arabia and the Arab world’s most populous nation are at loggerheads over Iran, Syria and various other issues.

Saudi Arabia suspended in October a $23 billion agreement to supply Egypt with 700,000 tons of petroleum products every month after Egypt supported a Russian resolution on Syria in the United Nations Security Council. The sanctions and cooling of relations have done little to make Mr. Al-Sisi more empathetic to Saudi concerns.

Finally, on the foreign police and defence front, this month’s inauguration of Donald J. Trump could prove to be a mixed bag that may aggravate Saudi Arabia’s problems. Mr. Trump has suggested that he may back away from US support for anti-Assad rebels in Syria and focus in cooperation with Moscow on defeating the Islamic State. That effectively would strengthen the free hand Iran, Russia and Mr. Al-Assad already have in Syria.

The President-elect has also hinted that he may scrap the international community’s nuclear agreement with Iran. Saudi Arabia has called on Mr. Trump not to cancel the agreement but to hold Iran to the fire over its support for proxies in Arab countries. A cancellation of the agreement could force Saudi Arabia into a nuclear arms race with Iran.

Mr. Trump’s suggestions that he may be more sympathetic to Israeli settlements in the occupied West Bank threatens to put the kingdom on the spot at a time that it has found common ground with Israel in seeking to halt Iranian regional advances. Mr. Trump’s pledge to move the US embassy from Tel Aviv to Jerusalem and his nominee as ambassador to Israel, David Friedman, who describes Jerusalem as the “eternal capital of the Jewish state” could further strain already trouble relations with the United States. Possible widespread protests against relocation of the embassy could move Arab states, including Saudi Arabia, to break off diplomatic relations with the United States and/or take other retaliatory steps.

Saudi Arabia is betting that Mr. Trump, the president, will rely on the experience of Mr. Trump, the businessman, to cut deals. The president-elect, however, has suggested that he could stop oil imports from the kingdom in his bid to make the United Sates energy independent. At one point, during the election campaign, he also blamed Saudi Arabia for the 9/11 attacks.

Uncertainty in its relationship with the US could not come at a worse moment for the kingdom. The Saudi government, beyond its foreign policy and military setbacks, has begun to unilaterally rewrite the social contract that underwrites it. The rewriting constitutes the end of a bargain involving a cradle-to-grave welfare system in exchange for surrender of political rights and adherence to Wahhabi social mores.

Cutbacks on subsidies, increased utility prices, reduced spending on education and social services, and streamlining of the bureaucracy in a country in which the state employs two thirds of the citizenry is a tricky business.

It’s even trickier in an environment in which the country’s basic power structure, a power sharing agreement between the ruling Al Saud family and the country’s religious establishment, is being challenged by the demands of economic and social change and increasing international association of Wahhabism with Islamic militancy.

King Salman and Prince Mohammed have a full plate for 2017. For them and the Al Sauds the core issue is survival.

With no credible alternative to the Al Sauds and the Middle East and North Africa’s recent experience of popular protest producing civil wars, jihadism and increased repression, Saudis are unlikely to revolt.

They will however demand a greater say and greater accountability, concepts the government has so far countered with increased suppression and authoritarianism.

Dr. James M. Dorsey is a senior fellow at the S. Rajaratnam School of International Studies, co-director of the University of Würzburg’s Institute for Fan Culture, and the author of The Turbulent World of Middle East Soccer blog, a recently published book with the same title, and also just published Comparative Political Transitions between Southeast Asia and the Middle East and North Africa, co-authored with Dr. Teresita Cruz-Del Rosario.