In the first voting of the day, Mr Obama won by 15 votes to six in the town of Dixville Notch, New Hampshire.
The town, which has a 60-year tradition of being first in the nation to vote, opened its polls at midnight, with turnout of 100%.
It was the first time the town had voted for a Democrat since 1968.