(CNN) — Barack Obama has won the Guam Democratic caucuses by a margin of 7 votes.
With all of Guam’s precincts reporting, Obama won 2,264 votes (50.1 percent) to 2,257 votes (49.9 percent) for Hillary Clinton, his sole remaining rival for the Democratic presidential nomination.
Obama led the vote count throughout the day and had a 52.7 percent to 47.3 percent advantage over Clinton by late afternoon. Clinton then won the sole remaining precinct - Guam’s largest village of Dededo - by a 61.9 percent to 38.1 percent margin, which brought her to within 7 votes of Obama in the overall tally.
Polls closed at 6 a.m. eastern time Saturday, but vote counting on the U.S. territory took over 13 hours to finalize.
Obama and Clinton will split the U.S. territory's four pledged delegate votes evenly, with two apiece.
The win gives Obama his 31st victory of the campaign, including his win in the Texas caucuses in March. Clinton has won 16 contests, including the Texas primary.
The battle for the Democratic nomination next heads to Indiana and North Carolina, which both will hold primaries on Tuesday.