Barack Obama has declared himself "the Democratic nominee for president of the United States".
He was speaking to a cheering crowd on the last day of the primary season, as projections showed he had earned enough delegates to clinch the nomination.
Of the states that voted, Montana was won by Mr Obama and South Dakota by his rival Hillary Clinton, US media say.
If confirmed as nominee, Mr Obama would be the first black man to represent a major party in a presidential election.
In her own speech to supporters, Mrs Clinton refused to concede and said she would make a final decision later.
BBC North America editor Justin Webb says a fabulously well-planned and executed campaign helped give him the edge over his rival.
Role for Clinton?
Mr Obama's speech was delivered in St Paul, Minnesota, where Republicans are set to hold their presidential nominating convention. more......