With 99 percent of precincts reporting, Clinton led Sanders by fewer than 2,000 votes -- a mere 0.4 percent of all those cast, according to The Associated Press. AP said the race was "too close to call."
"We just won Kentucky," she said on Twitter.
Going into Tuesday's primaries, Clinton had won 1,716 pledged delegates, while Sanders had 1,433. Kentucky has 55 pledged delegates, 37 of which are awarded proportionally and 18 of which are allocated based on the statewide results. The state also has five unbound delegates, also known as superdelegates, who are free to support either candidate at the convention. (Two of Kentucky's superdelegates have already pledged support for Clinton.)
Only registered Democrats could vote in Kentucky's primary.
Clinton, wary of Sanders securing another victory after his recent wins in Indiana and West Virginia, spent a lot of time and resources in the Bluegrass State ahead of Tuesday's contest. As The Huffington Post's Howard Fineman reported, she made eight stops in two days. She also spent around $180,000 on TV ads in the week before the primary.
Despite Clinton's strong delegate lead, Sanders insists he'll stay in the campaign until the Democratic convention. In recent weeks, he's attempted to convince voters that he'll be a stronger challenger to presumptive GOP nominee Donald Trump.
"Secretary Clinton does very well with Democrats and so do I, but there are a lot of independents in the country and we do very well with independents," Sanders said at a rally in Kentucky.
This article has been updated with Clinton's claim of victory.