Saudi Arabia’s king has removed his half-brother as crown prince, replacing him with his nephew, and elevated his son to the position of deputy crown prince, in the most significant repositioning of power among the royal family since King Salman assumed the throne in January.

The appointments, announced in a decree from the royal court, thrust a new generation of Saudi princes into the line of succession and potentially shaped the future of the throne for decades.

As crown prince, Mohammed bin Nayef, 55, is the most likely successor to the king. The prince, who is also the interior minister, is known internationally as Saudi Arabia’s counter-terrorism tsar and was previously also deputy crown prince.

He becomes the first of his generation to be elevated to such a high position. He has survived several assassination attempts, including one in 2009 by al-Qaida. He takes over from Prince Muqrin.

The royal decree also announced that the king’s son, Prince Mohammed bin Salman, is the new deputy crown prince. He is believed to be about 30 and is also the country’s defence minister. As deputy crown prince, he is regarded as second in line to the throne.

Both princes are part of a generation of grandsons of Saudi Arabia’s founder, the late King Abdulaziz al-Saud, whose sons have passed power from brother to brother since his death in 1953.

The royal decree said the appointments were made in line with the kingdom’s founding principle of “continuity on the basis of service to faith, the nation and the people, and what is good for its loyal people”.

Nayef will continue to oversee the country’s massive police force and border guards in his role as interior minister. As crown prince, he will also serve as deputy prime minister. His late father was the elder brother of 79-year-old King Salman.

The royal reshuffle came as the monarchy, a staunch ally of the US, faces a number of challenges, including creating millions of jobs for its mostly young population, low oil prices that have forced the country to dig into its financial reserves, and security threats both internally from terrorist groups and externally along its borders with Iraq and Yemen.

Since ascending the throne in January, the new monarch has presided over a more proactive foreign policy, including Saudi-led air strikes against Iran-backed Shia rebels in Yemen. Under the previous king, Abdullah, Riyadh had already joined the US-led coalition carrying out air strikes on Islamic State extremists in Syria and helping to arm rebels seeking to oust Syria’s president, Bashar al-Assad – another ally of Iran.

The new deputy crown prince, who oversees the air strikes in Yemen, will remain defence minister. He also heads a council overseeing economic and development issues.

Hamad al-Sweillam, meanwhile, has taken up the prince’s former position as the head of his father’s royal court – a kind of gatekeeper to the king. All Saudi citizens working in the country’s security or armed forces, including civilians, were also granted an extra month’s salary in the decree.

Another critical change was the removal of the longtime foreign minister, Prince Saud al-Faisal, who was replaced with Adel al-Jubeir, the kingdom’s ambassador to the US. Faisal, 75, who had served as foreign minister for 40 years, spent several months this year receiving medical treatment abroad. The decree cited health conditions as the reason for his retirement.

The king also moved Adel Faqih from the post of labour minister to that of economy minister. Khalid al-Falih was put in charge of the health ministry.

The most senior woman in government, Nora al-Fayez, was sacked as deputy education minister for girls. Shunned by ultra-conservatives, she was strongly pushing to get physical education on the curriculum for girls in Saudi public schools.

Muqrin, 69, had been largely seen as a transitional figure in his post as crown prince. The royal court statement said he was relieved on his request.