Security forces in Iran have been violently cracking down on protests sparked by the death in custody of a young woman.
Mahsa Amini, 22, was arrested for allegedly not covering her hair properly with a hijab, or headscarf.
What are the powers of the supreme leader?
The most powerful figure in Iran is Ayatollah Ali Khamenei, the country's supreme leader since 1989.
He is head of state and commander-in-chief. He has authority over the national police and the morality police, whose officers detained Mahsa Amini.
Ayatollah Khamenei also controls the Islamic Revolution Guard Corps (IRGC), which is in charge of internal security, and its volunteer wing, the Basij Resistance Force. The Basij have repeatedly quelled dissent in Iran.
As such, he has most say over how to deal with the protests.
President Ebrahim Raisi, is the top elected official and second in rank to the supreme leader.
He is responsible for the day-to-day running of the government and has significant influence over domestic policy and foreign affairs.
However, his powers are relatively limited - especially in security matters.
The president's interior ministry runs the national police force - which has been cracking down on protests. However, its commander was appointed by the supreme leader and is answerable directly to him.
The same is true of the commander of the Islamic Revolution Guard Corps and the Basij.
If the supreme leader wants protests to be ended with force, the president has little choice but to fall in line.
The president's powers can also be checked by parliament, which introduces new laws. In turn, the Guardian Council - which contains close allies of the supreme leader - has the job of approving new laws and can veto them.
Who are the morality police?
The morality police - or Guidance Patrols - is part of the national police.
The force was established in 2005 to uphold Islamic morals and laws on "proper" dress, which were introduced after the Islamic Revolution of 1979.
Its estimated 7,000 male and female officers have the power to issue warnings, impose fines or arrest suspects.
President Raisi, a hardliner, introduced several new measures for enforcing the hijab rules this summer.
Surveillance cameras were introduced to help spot unveiled women, and a mandatory prison sentence was introduced for people opposing the hijab rules on social media.
Who are the Revolution Guards?
The IRGC is Iran's main organisation for maintaining internal security,
It was set up after the revolution to defend the country's Islamic system.
The IRGC is now a major military, political and economic force in Iran, with more than 150,000 personnel. It has its own ground forces, navy and air force, and oversees Iran's strategic weapons.
It has an overseas arm called the Quds Force which secretly provides money, weapons, technology and training to allies throughout the Middle East.
It also controls the Basij Resistance Force.
What is the Basij?
The Basij Resistance Force, formally known as the Organisation for the Mobilisation of the Oppressed, was formed in 1979 as a volunteer paramilitary organisation.
It has branches in every province and city in Iran, and within many of the country's official institutions.
Its male and female members, referred to as "Basijis", are loyalists to the revolution and under the orders of the IRGC.
About 100,000 are believed to perform internal security duties.
They have been heavily involved in suppressing anti-government protests since the disputed presidential election in 2009.