Hillary Clinton limped over the line in Kentucky on Tuesday night. She narrowly secured the chance to declare victory—even though Bernie Sanders pushed her to a virtual tie and they are likely to split the state’s delegates evenly.

With 99 percent of precincts reporting, Clinton was leading by 46.8 percent to Sanders’s 46.3 percent.

Clinton spent the last two weeks crisscrossing the state in a bid to shore up an expected win and dent the prevailing sense that she is a weak frontrunner who is only getting weaker.

Tuesday did little to change that narrative.

Sanders scored a resounding win in his favorable state of Oregon—he was almost 10 points ahead with 73 percent of precincts reporting—while Clinton stumbled in the state where she was expected to win. She annihilated then-Sen. Barack Obama 66 to 30 percent eight years ago in Kentucky.

Keen to revive those memories, she has spoken about Bill Clinton often over the past few days. He remains popular in the state and was the last Democrat presidential candidate to win there.

On Sunday, she told a crowd her husband would be “in charge of revitalizing the economy, because, you know, he knows how to do it” in a future Clinton administration.

Prior to Kentucky and Oregon, Clinton has won five of the last eight contests; but Sanders has also been putting points on the board, winning an upset in Indiana as well as Rhode Island.

Losing to Sanders in Kentucky was unthinkable.

As the precincts were counted through a tense evening, the results were described on CNN as “tighter than a Speedo on Chris Christie.”

In the end, Clinton was able to claim the win, although there would be no speech to a cheering crowd. Instead, she wrote on Twitter: “We just won Kentucky! Thanks to everyone who turned out. We’re always stronger united.”

Sanders was the one holding a victory rally. He thanked the liberal state of Oregon for supporting him but also claimed a moral victory in Kentucky.

“In a closed primary—something I am not all that enthusiastic about—where independents are not allowed to vote... where Secretary Clinton defeated Barack Obama by 250,000 votes in 2008, it appears tonight that we’re going to end up with about half of the delegates,” he said.

Sanders was speaking in Carson, California, three weeks ahead of the state’s massive Democratic primary, which awards more than 500 delegates.

“We just won Oregon and we are going to win California,” Sanders said. “I am beginning to like the West Coast.”

Amid an increasingly rancorous nomination battle, Sanders once again told the Democratic establishment that he would not be dropping out of the race.

“I should tell you, there’s a lot of people out there, many pundits and politicians out there who say ‘Bernie Sanders should drop out, the people of California should not have the right to determine who the next president will be,’” he said. “[But] we are in till the last ballot!”

Clinton had planned to wrap up the Democratic race long ago so that she could concentrate her fire on Donald Trump, who took another step to officially clinching the Republican nomination in the Oregon primary.

On Twitter, Trump was reveling in her close race in Kentucky. “Do you think Crooked Hillary will finally close the deal? If she can’t win Kentucky, she should drop out of race. System rigged!” he wrote.

Later in the evening, Trump seemed to accept that Clinton’s narrow victory likely made her the nominee. He wrote: “I look so forward to debating Crooked Hillary Clinton! Democrat Primaries are rigged, e-mail investigation is rigged—so time to get it on!”