Were Hayes to somehow come out on top, she would become the first black candidate ever nominated by Connecticut Democrats. She would be the only black person serving in the U.S. House or Senate from all of New England. She would also become one of only a few black members of Congress serving a district where white people make up a majority of the voting population.

But her bid began picking up momentum almost as soon as she launched it. Her 2016 National Teacher of the Year designation earned her the attention she needed to get her calls returned, and delegations to the convention agreed to hear out her last-minute pitch. Local unions got excited, with firefighters, United Auto Workers, and others getting behind her.

She was facing off against a well-known, well-financed candidate who was largely expected to walk away with the nomination to replace the outgoing Elizabeth Esty unchallenged.

By any conceivable metric, Jahana Hayes had no chance. She launched her campaign just 12 days before Connecticut’s convention for the 5th Congressional District race on May 14, with no infrastructure, no real funding, and no prior political experience.

Hayes got in line with them. “I knew all the steps and everybody’s like, ‘How do you know that?’ I’m like, ‘Because they haven’t changed it,’” she told The Intercept. “It was born in the projects just to give us something to do.”

But she had overcome much higher odds. The Berkeley Heights housing project, where she grew up, is just four miles away from Crosby High School, where the convention was held, but last Monday, it felt like it was a world away. She was not making the journey alone. Outside of the convention was a scene not typical of Connecticut political events. A middle school drum line, known as the Berkeley Knights Drill Team and Drum Corp, was banging away out front, on hand to support their alumna.

Inside the convention auditorium, Hayes had flashbacks, as she spoke to the delegates from the same stage she would have walked across 28 years ago to pick up her diploma, had a pregnancy at 17 not gotten in the way. (“I always wanted to be a teacher, but when that happened, I was like, well, I guess I screwed that one up,” she told The Intercept.)

But Hayes was back, after battling through a school for expectant teens, then low-wage jobs, community college, her first teaching job, and graduate school. On stage, eyes were locked on the screen tallying the votes of the delegates, as it delivered the most unexpected news: The votes were in, and Hayes had won a majority, which local news reports put at 172-168. Her backers, along with the former students who’d come to see her, exploded in celebration.

But the night was far from over.

When the selection process began earlier this year, delegates to Connecticut’s 5th District endorsement convention thought that they had signed up for a sleepy affair. The sitting congressional representative, Esty, was widely expected to cruise to re-election.

But that was before a scandal surrounding her handling of a sexual harassment issue in her office forced her into early retirement, throwing the race wide open.

Just after Esty stepped down in early April, Mary Glassman jumped into the campaign. Glassman, who works for a local education agency, had run for lieutenant governor in 2006 and 2010 — losing the general election the first time, and then losing the primary on her second attempt. Glassman was also the former first selectman of Simsbury, a mayor-like position for a wealthy enclave on the outskirts of Hartford. She quickly raised $100,000 out of the gate, hoping to clear the field.

On Monday night, as the screen flashed the results, with Hayes in the lead, it was clear that the field had been anything but cleared. With the votes in, Tom McDonough, the convention chair for Connecticut’s 5th District, asked from the stage whether any delegates planned to switch candidates.

Vote switching is not unusual, according to local operatives familiar with Connecticut politics. But even as no delegates came forward to make a change, the period to switch candidates stayed open as people jockeyed on the floor.

Classic convention chaos ensued, with the delegation from New Britain, where Glassman grew up, playing a central role. Manny Sanchez, an elected official from New Britain, who had also been gunning for the endorsement early in the night, dropped out after the first ballot earned him 17 percent, and he released his local delegates. He said he spent the rest of the evening watching from the back. “Initially, it seemed like it was a split,” he told The Intercept of the New Britain delegation. “I stayed out of that process, told them to vote their conscience.”

Their consciences were apparently conflicted. The head of the New Britain delegation, Bill Shortell, made three separate trips to the stage to announce switches. When he walked away the last time, enough delegates had changed their votes to put Glassman over the top, with a count of 173-167.

“Things happened on the floor,” Sanchez summed up, “and votes changed.”

At that point, Glassman’s supporters began calling for the vote to be closed. And it was, quickly. McDonough declared that Glassman had won the official endorsement of the Democratic Party.

Chris D’Orso, who serves on the Board of Alderman for Waterbury and was a delegate to last Monday’s convention, has been deeply involved in local Connecticut politics for over twenty years. He told The Intercept he’s never seen anything like what he saw that night when it came to the vote switching period after Hayes emerged with the most votes. He described it as “all hell breaking loose” with people scrambling, resulting in “audible yells” from frustrated delegates in the room. “It wasn’t just Jahana’s delegates who were mad, tons of people were seriously confused why this voting period was still open,” he said. “It almost seemed like it went on just long enough for New Britain to make that last change.”

D’Orso, who ended up voting for Hayes, put it like this: “I can’t say if they were doing something on purpose, but you don’t have to be a conspiracy theorist to walk away and say ‘what just happened?'”

When reached by phone, Shortell described the situation as “very sensitive,” “very delicate,” and one he’s “not too inclined to talk about.” He later told the local press that “the switchers made up their own mind.”

After the gavel came down, Hayes’s supporters fumed together about what they saw as a racist injustice having been done. Hayes, according to people who were with her, calmed the group down, a real-life rendition of the iconic “Saturday Night Live” segment that aired after Donald Trump’s 2016 presidential victory, with mournful white liberals coming face to face with the meaning of the election results.

She told The Intercept that her life had prepared her for what happened. “They were very upset,” she said of her backers, “and I was like, guys, you don’t live this long in this community, in this skin with no — they were more upset than me.”

“I was like, you know, this was amazing that we even got this close,” she added. That night, she challenged her supporters to buck up, knowing that she’d have to raise an awful lot of money if she wanted to continue the race.

In Connecticut, any candidate who wins the votes of at least 15 percent of the delegates earns a place on the ballot, but the party endorsee almost always wins the primary. Winning at the convention gives the candidate a favored status at the top of the ballot and a special designation that indicates she is the favorite of the party. News coverage has mistakenly referred to Glassman as the nominee, and the party has publicly congratulated her, signaling support to primary voters, who tend to be well-informed, particularly in an upscale district like Connecticut’s 5th.

But that high level of education and engagement could rebound as a benefit to Hayes, too. In just a matter of days, she was able to turn a coronation into a contest. In the wake of the convention, she asked her political friends what came next, and they all told her the same thing: Raise a mountain of money; with enough of it, you can defeat Glassman (again) in the August primary.

The day after the convention she called on her supporters to make 1,000 contributions of $10 each in 24 hours to show that her campaign had real grass-roots support. (She says she hit the $10,000 mark easily.)

But a primary like hers can cost several hundred thousand dollars, and her only realistic hope of raising the money needed to make it competitive is to strike a chord with small donors around the country.