(iStock)

Many things were done wrong to the woman near the end of her short life.

Once, when she was 27 and living homeless in Edmonton, she was dragged screaming into a man's apartment, held down, had her clothes ripped off, then was choked, stabbed and violated.

The next year, another man accidentally shot and killed her.

But it's the revelation of what was done to the woman between her sexual assault and her death that has outraged and scandalized the Canadian justice system.

For five days in 2015, as the woman testified against and helped convict Lance David Blanchard, 59, of kidnapping and aggravated sexual assault, she was locked up alongside him — as much a prisoner as her attacker.

They were brought from jail to court in the same prison van. Sometimes they were held in nearly adjacent cells. The woman testified in leg shackles though she was accused of no crime, simply because prosecutors feared she might not show up to court the next day — though she had never failed to do so.

“The facts of this case are disturbing and tragic, and when you add in the treatment of the victim in the system, they are almost incomprehensible,” Alberta Justice Minister Kathleen Ganley told reporters Monday, after details of the woman's treatment were first reported by CBC News.

“It does keep me up at night wondering whether, if she had been Caucasian, and if she had been housed and not addicted — whether something might have been different,” Ganley told the station.

The woman's identity is not revealed in court records. Hints of her circumstances and personality are, however.

She testified that she was a high school graduate who grew up in an aboriginal community near Edmonton. She was surviving off charity meals in summer 2014 — a tub of soup from a day care, for instance — and always made sure to return the containers.

She had a habit of carrying handwritten poems in her sock, she told the court, which she would leave for strangers to find.

“Cute little things like that might make life beautiful,” she testified at the trial, in leg shackles, after one of her poems was found at the scene of her sexual assault.

The woman had been walking a while and began to feel cold on the afternoon of June 16. So she slipped into an apartment building and fell asleep in the stairwell.

She woke, she testified, to a strange man pulling her hair, a knife at the side of her face.

Blanchard dragged her kicking into his apartment, she told the court, tore her jacket and shirt off and had his way with her — though she fought all the while.

At one point in the attack, he stabbed her through the hand so that she could not turn a doorknob when she momentarily broke free from his grip.

“I was praying I would die before anything else happened,” she later told a court, according to CBC.

The woman saved herself by dialing 911, putting the phone on speaker and chucking it across the room so Blanchard could not turn it off.

“He stabbed me!” she screams over and over in audio of the call, as Blanchard accuses her of breaking into his home. (He lied about nearly everything that happened, the court later found.)

When police came, they found blood all over the apartment and the woman. Court records describe an emergency room doctor's report on the woman's mental state: She was "fluctuating between falling asleep and crying.”

A year passed, during which the woman relived the experience in nightmares. She was still homeless by summer 2015, but showed up on time to testify against Blanchard at his preliminary hearing.

Her testimony didn't go so well.

“She was clearly agitated and aggressive,” wrote judge Eric Macklin, who was not involved in the hearings but later reviewed them. “She showed animosity to the Accused and resented being in his presence.”

But the hearing judge made mistakes too, Macklin wrote — like accidentally calling the woman by her attacker's name, which further upset her.

At the end of the day, Macklin wrote, prosecutors invoked a Canadian law that lets judges imprison witnesses who refuse to testify.

“She was remanded into custody on the mistaken belief that she was 'a flight risk' and that 'she was simply incapable of participating properly in the Court proceedings,' " Macklin wrote.

“No one canvassed the possibility at that time of having her monitored by a victim support worker,” he added.

After a weekend in jail, the woman arrived back at court the next Monday in handcuffs, which were removed, and shackles, which remained on all day.

“Metallic rattling echoed as a sheriff escorted the 28-year-old to the witness stand,” CBC News wrote.

After a night in jail, the woman apologized for her last performance, according to court records. She asked to be released until the days-long hearings were over. The jail food was terrible, she said, and the showers were covered in feces.

She promised to show up on time and testify.

“She emphasized that she was the ‘fricking victim here,’ ” Macklin wrote.

But she was not set free that day, or the next. Not for five days, until she had finished her testimony. And despite the woman's evident discomfort around Blanchard — at one point lying to the court that she had no children, because she didn't want him to know about them — attacker and victim were essentially held as roommates for much of the week.

“On many occasions, she was required to walk right past the Accused in order to exit the courtroom,” Macklin wrote. “She was often housed in a cell next to or near that of the Accused. … On at least two occasions, she was transported between the Remand Centre and the Courthouse in the same transport van as the Accused.”

All that, he wrote, despite the fact that she “had never failed to appear” for any summons.

And despite it all, the judge wrote, her testimony was clear, compelling and supported by witnesses and evidence.

Far from being an unreliable witness, he wrote, she was somewhat charming.

“She spoke of having some artistic talent,” Macklin wrote. “And displayed a sense of humor when suggesting that drawings she had taken depicting the Accused’s apartment and the Accused were not of Picasso quality.”

In the end, Macklin found Blanchard guilty on nearly every count, and the woman's treatment by the justice system “appalling.”

“I was only able to hear the Complainant’s testimony,” the judge concluded. “Unfortunately, her life circumstances did not allow society to see or experience her intelligence and artistic qualities.”

By the time he wrote those words, last December, it was too late for society.

Half a year after the government held her prisoner to testify against a man who had held her prisoner, the woman died in December 2015 in an accidental shooting. It was unrelated to the assault, according to CBC.

Her first attacker, Blanchard, is in prison. And the man who shot her has pleaded guilty to manslaughter, according to CBC. She died before she could see any justice done.

Ganley, Alberta's justice minister, apologized to the woman's mother in her stead last week — and ordered a review of the laws that allow prosecutors to imprison a witness.

Like others, Ganley also wondered whether the woman's race and circumstances — Cree and homeless — played a role in the wrongs done to her.

“None of us will ever really understand what it was like for her to sit there and stare at the man who did this to her,” Ganley told CBC. “While she's trapped, essentially.”

More reading:

Duterte jokes that his soldiers can rape women under martial law in the Philippines

Seven transgender women have been killed this year. Democrats want Jeff Sessions to investigate.

The story behind a powerful photo of a Czech girl’s contempt for neo-Nazis