If prosecutors had waited a few more weeks, the 12-year-old accusation that Bill Cosby had sexually assaulted a woman would have legally expired, his first public accuser would have lost her last chance at a trial, and Cosby would not be facing the possibility of a decade behind bars.
Instead, Pennsylvania prosecutors scraped in under the wire, bringing the first criminal case against the legendary comedian shortly before the state's deadline for filing charges of aggravated indecent assault lapsed this month.
The last-minute case has highlighted a subtle but unavoidable fact of life for alleged rape victims: Their cases have legal expiration dates that vary widely across states and create pressure to build a prosecutable case with sometimes limited evidence.
The case involving Andrea Constand, which could become one of the most widely watched sexual-assault prosecutions in history, is a stark example of what's at stake: She told police a year after the alleged assault, but prosecutors determined there wasn't enough evidence to win a conviction.
Not until new evidence came to light this northern summer was the case reopened.
More than 50 women have accused Cosby, 78, of sexual assault in incidents dating back to the 1960s, and most of their cases have already legally lapsed.
Experts say deadlines for prosecuting such crimes help protect the legal process from decayed evidence and faded memories.
Stories such as Constand's, in which charges are filed just before the statute of limitations runs out, are rare, advocates said. Defence attorneys could seize on the move to question the judgment of prosecutors and suggest that the case was rushed to meet a deadline - or as a way to score political points.
The newly elected Montgomery County district attorney who filed the charges, Kevin Steele, won in November after vowing to take on the Cosby accusations his opponent had passed on a decade ago.
Cosby's lawyers have vowed to "mount a vigorous defence" against the charges, and lawyer Monique Pressley told the Today show yesterday Cosby was the victim of "a game of political football". Cosby, who is free on US$1 million ($1.46 million) bail, could face up to 10 years in prison.
In January 2004, Constand, then a director with the women's basketball team of Temple University, Cosby's alma mater, visited his gated mansion outside Philadelphia to discuss her career with the man she saw as a mentor.
After Cosby offered her three pills - what he called "herbal medication" - she felt dizzy and weak, she said. Her "knees began to shake, her limbs felt immobile ... and she began to feel only barely conscious", her lawyers wrote in a 2005 civil court filing.
While she was incapacitated, she said, Cosby fondled and raped her; he later called the act consensual. When Constand told police in 2005, prosecutors declined to file charges, with Montgomery County's then-District Attorney Bruce Castor saying Cosby and the victim could be portrayed in a "less-than-flattering light". Records from Constand's civil case against Cosby were sealed after she settled in 2006 on undisclosed terms but were released by a federal judge last year. In them, Cosby revealed he had given consciousness-altering quaaludes to women with whom he wanted to have sex.
That new evidence prompted the Montgomery County District Attorney's office to reopen Constand's case - unique, said James Shellenberger, a law professor at Temple University, in that media attention probably raised it from the legal grave. The combination of public outrage and lurid details from those unsealed court documents probably prompted a renewed investigation, he said.
"The fact that more and more of these incidents were being reported certainly caused this case to be seen as a more serious matter," Shellenberger said. "We're not thinking of a person who may have committed one sexual assault, but a person who may have committed 50."
Statutes of limitations, originating in Roman law, protect defendants who, over time, can lose access to evidence necessary to disprove accusations against them. As of 2014, 34 states and Washington set statutes of limitations on filing sexual-assault charges, ranging from three years to three decades.
Advocates say sex-crime statutes of limitations have often imposed harsh deadlines on both investigators assessing the crime and on victims still struggling to deal with the attack.
Some victims put off going to police because they fear family, friends or law enforcement will blame or judge them for what happened, said Monika Johnson Hostler, president of the National Alliance to End Sexual Violence. Nearly 70 per cent of sexual-assault victims don't tell authorities about their assaults, the Justice Department estimates, and less than 10 per cent of rapes lead to an arrest.
"It takes a lot to come forward," Hostler said. "We see that with victims of all ages. They need time to think about it. They may feel ashamed."
Lawyers for alleged rapists often see stalled cases as a way to sow doubt in accusers' accounts. Martin Singer, a former Cosby lawyer, often cited the age of the accusations to undercut them, calling the women's claims "unsubstantiated, fantastical stories about things they say occurred 30, 40 or even 50 years ago".
"When there's a time lag between the event and reporting it, the defence attorneys are always going to latch on to that and use that to try to sway public opinion," said Scott Berkowitz, founder and president of RAINN, a sexual-violence victims' advocacy group.
"But [in the Constand case], there was no significant delay before reporting. There was a delay in prosecuting."
The Cosby case became a political flashpoint in Montgomery County, Pennsylvania, where Castor, who had declined to charge Cosby, lost his seat to Steele, who announced the charges against Cosby on Thursday.
Steele's win was widely read as a sign that Cosby could soon be charged.
Castor said in July that he would have been open to prosecuting Cosby himself had he won the race, but Constand's lawyer, Dolores Troiani, had said her client wouldn't co-operate with a reopened investigation under Castor's leadership.
"How can we possibly trust him?" Troiani told the Philadelphia Inquirer.
Filing the case under the wire could raise questions over whether the prosecutor's judgment had been hurried or compromised. But legal analysts said the timing of the charges was a function of events out of Steele's control: The new evidence was unsealed just a few months before the legal deadline.
"If the statute of limitations is about to expire ... they have no choice," said Linda Dale Hoffa, a former federal prosecutor and current criminal defence attorney at the Dilworth Paxson firm in Philadelphia. "If they miss it, they can't bring the case, and that can certainly push them to move faster than people might expect."
Advocates who have fought to end or extend sex-crime legal deadlines have found recent success.
In Indiana, prosecutors can now file rape charges after the state's five-year deadline if new evidence is discovered.
"Jenny's Law", enacted in April last year, was named for a woman whose rapist turned himself in nine years after the attack but could not be arrested because too much time had passed.
In July, Florida widened its prosecution window to eight years from four, inspired by a woman, Danielle Sullivan, who reported her rape 43 days too late.
And in California, politicians are moving to join states such as Virginia and Maryland in eliminating the sex-crime statute of limitations altogether.