AMMAN (Reuters) - 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.

FILE PHOTO: Jordan's King Abdullah speaks during an extraordinary meeting of the Organisation of Islamic Cooperation (OIC) in Istanbul, Turkey, December 13, 2017. REUTERS/Kayhan Ozer/Pool

The king, a staunch U.S. 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 reorganization 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.

“These fabricated news circulated recently are aimed at undermining Jordan and its institutions,” the statement said.

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.

The king, who himself is an elite special forces commander, said the restructuring plan aimed to reorganize 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.