NEW HAVEN, N.H. — Vermont Sen. Bernie Sanders and Democratic presidential candidate Hillary Clinton were neck-and-neck in New Hampshire with more than half of the vote counted Tuesday night, according to a New Hampshire State Department of Public Safety and Elections official.

Clinton won with 52 percent of the votes and Sanders with 48 percent, according a state department official who was not authorized to speak publicly.

Sanders won the state with 62 percent of votes cast, while Clinton had 41 percent, the official said.

Sanders was in a virtual tie with Clinton in the Palmetto State, but the two have narrowed the gap since Tuesday night.

The two candidates were tied in New York with 46 percent of voters casting ballots in the state’s primary on Saturday, according, the state department said.

The Associated Press contributed to this report.