"I'm leaving because I have made the judgment that I cannot be elected president of the United States," Graham said in announcing his exit from the race on CNN's "Larry King Live."
He said he was not successful because he started his campaign too late and had trouble raising money.
Graham, one of the most popular lawmakers in his home state of Florida, said he has not decided whether he would run for re-election to his Senate seat, which he has held since 1987.
During the campaign, Graham cast himself as the Democrats' most experienced and electable presidential candidate, but he struggled near the bottom of the 10-way nomination race.
In seven months of fund raising, he brought in around $5 million, not enough to compete with six Democratic rivals who raised at least twice as much. Graham's advisers said he was down to less than $1 million in his account — not enough to run a credible nationwide campaign.
Some of Graham's top presidential operatives announced they were leaving in recent days, and news articles reported that his campaign may be ending. Graham kept his final decision to end his bid to a close circle of longtime trusted advisers who supported him during his time in the Senate.
He didn't tell his top campaign staffers, who were left to speculate about the future of their jobs until the announcement on CNN.
Graham had considered running a shoestring campaign focused in just a few states with a small staff. He sounded like he was committed to stay in the race as late as Saturday, when he told a meeting of the Democratic National Committee: "I will win the presidency by leading America with honor out of the quagmire of Iraq."
Graham based much of his campaign on his vote against the military conflict in Iraq. But some anti-war activists preferred Howard Dean's fist-pounding indignation to Graham's calm, measured arguments against President Bush's foreign policy.
Graham's composed manner camouflaged his harsh accusations against the White House. He accused Bush of endangering Americans by abandoning the fight against terror to wage war in Iraq, a country that he said did not pose an immediate threat to the United States.
He said the White House had a "Nixonian stench" and a pattern of keeping information from the American people. He called Bush's tax cuts "immoral" and "an economic dagger pointed at the backs of all Americans."
He went so far as to suggest impeachment. "If the standard of impeachment that the Republicans set for Bill Clinton — a personal, consensual relationship was the basis for impeachment, would not a president who knowingly deceived the American people about something as important as whether to go to war meet the standard of impeachment?" he asked in July.
Graham delayed his entry into the race to recover from major heart surgery in January. His campaign strategy focused on courting conservative, rural voters — so-called NASCAR Democrats who normally don't vote in large numbers. He even sponsored "Bob Graham for President" Ford truck, No. 50, which completed in the NASCAR Craftsman Truck Series.
He also continued his campaign trademark "workdays," trying to connect with voters by taking on various jobs, such as civics teacher, busboy and railroad conductor.
Graham backed away from another of his traditions, closing his notebooks to the media. For 25 years, he has kept detailed daily logs of his personal and political activities and wouldn't shy away from pulling them out to show voters or reporter.
His presidential campaign advisers said coverage of Graham's notebooks had become a distraction and they would no longer release the contents.
Graham said he would continue to fight to make America more secure than it's been since the Sept. 11 terrorist attacks. He took a final shot at Bush even as he ended his campaign Monday night.
"Our nation stays focused on the war on terror until it is won," he said in a written statement accompanying his announcement. "We must reject distractions from that victory. The quagmire in Iraq is a distraction that the Bush administration, and the Bush administration alone, has created."