Iranian moderates have won a majority in the Assembly of Experts, a clerical body that is tasked with choosing the supreme leader of the Islamic Republic, and which was previously dominated by hard-liners.

The 88-member body is elected every eight years, and may choose the successor to Ayatollah Ali Khamenei, who has been Iran's top decision-maker since the founder of the Islamic Republic, Ayatollah Ruhollah Khomeini, died in 1989. Khamenei is 76 years old and underwent prostate surgery in 2014, raising concerns about his health.

The newly elected body could therefore play a major role in shaping the future of Iran, which is deeply divided between hard-liners who are hostile to the West and relative moderates who want to expand freedoms and improve relations with the international community.

The Associated Press explains the Assembly of Experts, the latest election, and what it means for Iran's future.

WHAT IS THE ASSEMBLY OF EXPERTS?

The body consists of Islamic scholars or clerics who are popularly elected every eight years. In theory, they have the ability to appoint or dismiss the supreme leader, and to question his policies. But in reality, the assembly has always deferred to his leadership.

The scholars are supposed to be above politics, but many are aligned with the country's political camps and have served in other offices. President Hassan Rouhani and former President Akbar Hashemi Rafsanjani are well-known moderates, while Ayatollah Ahmad Jannati is a leading hard-liner. All three retained their seats in the Assembly of Experts in the election.

WHY DOES THE ELECTION MATTER?

The supreme leader has the final say on all major policies in Iran and exerts power throughout the ruling system, including by appointing half the Guardian Council, a powerful body that vets election candidates. He also appoints the chief of the judiciary, controls state radio and TV and dozens of other unelected institutions, and is the country's commander-in-chief. That means Khamenei's successor will have a major influence on the future direction of the country.

The election changed the balance between the two camps, with the moderates winning nearly 60 percent of seats after holding less than 25 percent in the previous assembly. Two staunch hard-liners -- Ayatollah Mohammad Yazdi, the current head of the assembly, and Mohammad Taqi Mesbah Yazdi, the spiritual mentor of hard-liners -- were not re-elected.

WHAT KIND OF SUCCESSOR DO THE MODERATES AND HARD-LINERS SEEK?

If the moderates have their way, the next supreme leader will favor the expansion of democratic freedoms and greater openness toward the West. The hard-liners would likely prefer a leader even more hard-line than Khamenei, who is deeply suspicious of the United States and fears Western influence could undermine the Islamic Republic.

The moderates tend to see the government's legitimacy as deriving from elections, while hard-liners see it as coming from adherence to a strict interpretation of Islam regardless of its popularity. Both camps, however, remain committed to the ruling system and the role of Islam in public life, meaning the next supreme leader is unlikely to favor radical change.

HOW DOES THE ASSEMBLY CHOOSE THE NEXT SUPREME LEADER?

The Assembly of Experts has only chosen a supreme leader once, after Khomeini's death in 1989, so there is little precedent to go by.

The assembly also conducts much of its work in secret. The names of potential successors are kept secret, and the assembly covertly monitors their personal and public lives. Rafsanjani broke a taboo in December when he said a committee within the assembly has begun putting together a list of possible replacements for Khamenei.

Should Khamenei pass away or become incapacitated, the assembly would meet to vote on a successor, who could come from within the body or outside of it. They would then hold a secret ballot where the candidate would be chosen by a simple majority. The successor would then be announced to the public.