One of the world’s most prestigious centres of Islamic learning has issued a fatwa against child marriage, saying marriage should be based on the consent of both parties and “particularly the young woman”.

The deputy grand imam of al-Azhar, considered by some Muslims to be the highest authority of Islamic jurisprudence, hammered out the document with his team and young activists at the first African summit on child marriage and female genital mutilation, which took place in Senegal this week.

If news of the fatwa’s existence can reach imams in countries with high rates of child marriage, activists hope that the practice can be stopped, as they could not deny al-Azhar’s authority.

“Marriage in Islam is based on the consent of both parties, particularly the young woman. Such consent requires the young woman to have reached the age of maturity and reason, so that her consent is validly given,” the fatwa read, adding that this age was 18, and quoting parts of the Qur’an and the hadiths of the prophet Muhammad to support it.

The summit was organised by Jaha Dukureh, a Gambian campaigner and the founder of Safe Hands for Girls, herself a survivor of child marriage and FGM, who drove a successful campaign to end FGM in her country.

Dukureh, who went to Egypt to talk to the al-Azhar clerics last year, described how towards the end of the summit she realised that the fatwa had not yet been issued and went to talk to the imam, Salah Abbas. She, the African Union youth envoy Aya Chebbi and the Syrian journalist Abdalaziz Alhamza worked with the Egyptian imams to turn their rough draft, scrawled on hotel notepaper, into a formal document.

“We sat there on the floor with them, writing the fatwa. They had to call Egypt to ensure that everything was in line. And then there was a back and forth about the languages, because in Arabic things can be translated different ways. To me, it was just amazing watching that process.”

Aya Chebbi and Abdalaziz Alhamza with the deputy grand imam of al-Azhar, second from left, and his team. Photograph: UN Women

Four in 10 young women in sub-Saharan Africa are married before their 18th birthday. Boys are affected too – according to recent UN data, roughly one in 30 worldwide were married as children, with the highest number in Central African Republic, where almost a third of boys and men were child grooms.

The problem is not limited to Africa – across the world, 12 million girls are married in childhood every year. In Iraq in 2017, parliamentarians drafted a law that would allow children as young as nine to marry, based on the idea that the prophet Muhammad married his wife Aisha when she was just nine years old. The prime minister blocked the bill last year, but there are fears it will be reintroduced.

“When you force a girl to get married, you’ve given someone the right to rape her over and over again,” said Dukureh, who was married at 15 and again at 17. “And every single day, every time she’s touched … you don’t forget. I don’t think you forget that. I don’t think you ever get over that.

“I don’t think we understand the depth of what this [fatwa] could potentially do, and especially in communities where people continue to use religion to justify millions of girls’ pain and suffering.”

Part of the target group is Dukureh’s own father, an influential imam in Gambia.

“If I go to my dad, and give him the same statement that al-Azhar did, he wouldn’t listen to me. But if the deputy grand imam of al-Azhar is here, yes,” Dukureh said.

Her father appeared in a Guardian documentary made about her fight to stop FGM. She convinced him not to allow his baby daughter to be cut – the first girl in their family not to go through FGM.

Child marriage was something he never discussed, though.

“We came to a point of agreement when it comes to FGM. We never had a resolution on child marriage. Even my brothers, they would always tell me, you know, you can talk about FGM all you want. But with child marriage, you can’t touch it because the prophet’s wife was nine when he married her. So don’t even go there.”

Aya Chebbi holds a hastily written draft of the fatwa on hotel notepaper. Photograph: Louis Leeson

But Dukureh convinced her father to come to the summit. In his white robes, cap and sandals, he prayed throughout, and later said: “I cried so much, because I learned so much.”

As well as the fatwa, the activists, religious and traditional leaders, government ministers and religious officials came up with a declaration on Africans taking a lead to stop FGM and child marriage, which they are asking countries to sign up to. Many organisations aim to eliminate the practices by 2030.

Much of the funding for the summit, which cost roughly $1.2m (£946,000) and was supported by the World Bank and UN population fund, came from individuals and grassroots organisations.