Image copyright AFP Image caption Khadija Siddiqui, 23, was stabbed in her neck, abdomen and arms in a vicious attack

On Wednesday, Khadija Siddiqui, a young Pakistani law student, watched the man who stabbed her 23 times in broad daylight re-convicted for the crime.

It was the culmination of a three-year battle for justice that at one point saw the convicted attacker, her ex-boyfriend, acquitted by the High Court and allowed to walk free, sparking outrage and a fierce social media campaign in a country where hundreds of women are murdered in "honour killings" each year.

"Today is a day of victory for all women," she told reporters outside the Supreme Court after the ruling, which upheld a five-year sentence from a lower court. "A precedent has been set that if you raise your voice for truth, you will taste victory."

Ms Siddiqui, who was 21 when she was brutally attacked and now studies in the UK, comes from a typical urban and educated but conservative Pakistani family. She grew up in an environment that encourages women to be modestly dressed and cover their head, but also allows them to mix with males and have a say in choosing their husbands.

During her second year of law school, she started a relationship with Shah Hussain, which soon soured.

She has described him as a jilted lover, someone "who had a violent streak, and was given to coercion and blackmail".

"He was like one of those men who treat women as they do slippers on their feet; who think they can do what they want and expect no complaints," she told BBC Urdu last year.

"When he hacked my social accounts, I ended my relationship with him. He resorted to threatening me, and made several calls to my friends and a cousin asking them to tell me to speak with him or else."

Media playback is unsupported on your device Media caption The model and the mullah

Seven months after their break-up, in May 2016, Khadija was attacked by a man wearing a motorcycle helmet after picking up her six-year-old sister from school in central Lahore.

She was getting into the backseat of her car at the time when he launched into a stabbing frenzy. She was stabbed 23 times, including in her neck, abdomen and arms. Her little sister, who tried to intervene, was also hurt.

The family driver grabbed the attacker from behind. As they grappled, his helmet fell off and he fled from the scene.

The first formal complaint was lodged by her driver who did not, at that point, identify the assailant. A week after the incident, Khadija formally named him. She told me she had recognised him from the first moment of the attack but Hussain's lawyers and even a Supreme Court judge questioned why it took her so long to formally identify him.

More from Ilyas in Pakistan

But the police investigation appears to have been shoddy from the start. This is not uncommon in Pakistan, but Ms Siddiqui's lawyers and family have maintained that it was influenced by supporters of Hussain, whose father is a prominent lawyer.

For example, instead of registering the helmet and blood-stained clothes of Khadija and her sister as evidence, these items were returned to the family, according to Ms Siddiqui's lawyer Hassaan Niazi.

Later, when the material was finally handed to the police for DNA-testing, there were further delays.

"While the police told us the material has been sent to the laboratory, the laboratory officials said they hadn't received the samples," said Mr Niazi.

Meanwhile, the family was grappling with other challenges.

The first was Khadija's health. Half a dozen of her stab wounds were two inches deep and she was lucky to be alive. Her body was covered in at least 60 stitches.

They were also having trouble obtaining legal representation. They were forced to hire several lawyers, as one after the other they left the case.

Witnesses say those lawyers were heckled and mobbed by other lawyers supporting Hussain's family.

Hussain's father, Tanvir Hashmi, a senior lawyer in the south of the state "wields considerable influence on lawyers across a large belt in Punjab", said Jibran Nasir, a lawyer and activist who has been campaigning for Khadija Siddiqui since her troubles began. "So lawyers who aspire to develop good contacts across the bar would be loath to annoy [him]."

In an interview on Friday, Mr Hashmi denied that he had acted improperly, questioning why lower courts - said to be more amenable to outside influence - would have convicted his son if he really had the power he is alleged to possess.

"They say I'm influential, which is belied when a lower court convicted my son. The Lahore High Court ruling [which acquitted Hussain] brought out all the lacunae in the prosecution's case and that's why Hussain was acquitted."

The Supreme Court's decision was a "shock ruling", he said, which has "caused a wave of anger among the legal fraternity". He said the family's legal team was yet to decide if it would ask for a review of the ruling.

Image copyright Getty Images Image caption Justice is often elusive for female victims of violence in Pakistan

Ms Siddiqui's family also allege that they received offers of money to drop the charges from powerful people in the state.

"There were times when we were so frustrated we seriously considered their offer, but the only thing that made me reluctant was the fact that they were not apologetic," she said.

"They continued to paint me as a woman of questionable moral character, of having multiple illicit relationships. They tried to convey to us that we had no case, and that Hussain was going to be acquitted in any case. So I refused. And my family stood by me, which gave me courage."

Things started to change when activists took up the case and began a social media campaign under the hashtags #JusticeforKhadija and #FightLikeKhadija, attracting international media attention.

There was also a rebellion of sorts within the bar by a group of young lawyers, which further raised the profile of the case.

Ms Siddiqui and her supporters were finally able to secure Hussain's conviction and a seven year jail term in 2017. A session court later commuted his sentence by two years, and the Lahore High Court last June overturned the conviction entirely, devastating her and her supporters and shocking many in Pakistan.

They took heart when the Supreme Court, amid the uproar, decided to use its powers to re-examine the case, even without a formal complaint.

In her comments to the media after Wednesday's ruling, Ms Siddiqui had some words for both those who stood in her way and those who stood behind her.

"Law is a noble profession," she said. "Please uphold its sanctity. Don't stand in for falsehood. Don't abuse the status your profession has given you in the society. This is what motivated the young lawyers who have made a stand for truth in our case."