Jordan’s royal palace warned it would take legal measures against anyone spreading what it said were lies about the ruling family, just days after King Abdullah relieved his brothers from top army posts in a major shakeup.

The king, a staunch US ally, said on Tuesday that his brothers Prince Ali and Prince Faisal and his cousin Prince Talal – who all had high military ranks – would be retiring from the armed forces.

He said the move was part of a reorganisation of the armed forces’ hierarchy and structure.

Prince Faisal was head of the royal air force and deputy chief of staff, while Prince Ali had for years been in charge of the royal guards responsible for the king’s protection.

Talal Bin Mohammad, a Sandhurst graduate who was and an officer in the elite special forces, was also sent into retirement. They were all given honorary promotions.

A palace statement on Sunday said it would pursue legal measures against those who propagated “lies and false claims” in social media and online websites with the goal of driving a wedge between the royal family and ordinary Jordanians. The statement added:

These fabricated news circulated recently are aimed at undermining Jordan and its institutions

A Jordanian army source said the move by the king was prompted by a desire to set an example that the Hashemite ruling family was not above the law ahead of an anticipated move to retire dozens of senior army generals.

Read: Israel and Jordan secretly resume negotiations on Dead Sea Canal project

The king, who himself is an elite special forces commander, said the restructuring plan aimed to reorganise the 120,000- strong army by cutting costs and creating a more lean and effective force better equipped to modern warfare against terrorist groups.

The kingdom, which borders both Iraq to the east and Syria to the north and Israel to the west, has escaped relatively unscathed from the regional turmoil around it.

Many of the top army brass are drawn from native Jordanian tribes who form the backbone of the support for the royal family and play a dominant role in the army and government.

Jordanians see the royal family as a unifying force that holds together a country where many of its citizens are Palestinians whose families settled after successive Arab-Israeli wars, placing the kingdom at the heart of the conflict.

Opinion: Jordan and Saudi Arabia in a changing region… Is Amman seeking new alliances?