New Hampshire is the smallest of the battleground states, with just four electoral votes, and for much of the fall it has seemed an afterthought to the candidates as they’ve campaigned across more prominent contested states.

That changed Thursday with the arrival of President Obama at a downtown rally on a brilliant fall day. His appearance, and the later kickoff of a 24-hour campaign swing through the state by his surrogates, underscored the state’s potential significance in the competition for the 270 electoral votes needed to win the White House in November.

Ohio, Virginia, Florida and some other bigger states may be seeing the candidates on a more regular basis, but over the next 19 days, the battle for New Hampshire will be waged with the same intensity as elsewhere. The Obama and Romney campaigns differ about where the race stands here, but both agree that in an election as close as this one appears to be, no electoral vote can be taken for granted.

Recent public polls have produced conflicting portraits of the state of play here. One showed Obama with a six-point lead, while others show the race statistically tied. Obama campaign advisers say they hold the lead now and are confident they can keep it. Romney campaign officials say the race is a tossup. Democrats not working directly for the president’s campaign say they see a tie. In fact, they say that every top race in the state is tight.

“You could put a piece of paper between the two candidates right now,” Nick Clemons, a Democratic strategist with long ties to New Hampshire politics, said of the presidential race. “Both congressional races are very tight. The governor’s race is neck-and-neck. It’s a classic New Hampshire election.”

Explore the 2012 electoral map and view historical results and demographics

Tom Rath, a New Hampshire GOP strategist and Romney campaign adviser, said that “both candidates, both parties, are in a position to win.” That’s an improvement for the Republican nominee since mid-September, when he fell behind the president here as elsewhere. The presidential debate in Denver two weeks ago helped turn around his fortunes.

After losing the New Hampshire primary to Hillary Rodham Clinton in 2008, Obama won New Hampshire in the general election by nine points, a relatively easy victory compared with the slender margins that marked the two previous elections. In 2000, Republican George W. Bush won the state by one point over Vice President Al Gore. Four years later, Bush lost the state to John F. Kerry by a point. New Hampshire was the only state that year that switched from Republican to Democrat.

Since that 2004 race, New Hampshire has seen dramatic swings in its state elections. Democrats made a huge sweep in state races in 2006, dominating the legislature after years of Republican control. Two years ago, state Republicans stormed their way back into power, although popular Democratic Gov. John Lynch was reelected.

In primary elections, New Hampshire’s electorate is notoriously fickle, capable of shifts in the polls in the final days before the voting. Even in a general election like this one, many voters, especially the sizable independent bloc, may wait until the very end before deciding how they will vote.

Although Obama is vulnerable nationally because of the economy, economic issues may hurt him less here. New Hampshire did not feel the pain of the recession as much as other states. Its unemployment rate as of September was just 5.7 percent, unchanged from August, when it was tied for the seventh-lowest in the country.

Two competing aspects of New Hampshire’s political culture, however, could tip the balance in either direction. One is the state’s aversion to taxes and debt and its affection for small government. That could push voters toward Romney if he makes those fiscal issues a centerpiece here in the final weeks of campaigning.

Working for Obama is the state’s history of being in the forefront of women’s issues. It was the first state to ratify the Equal Rights Amendment (which eventually fell short of full ratification nationally). New Hampshire’s electorate is fiscally conservative but liberal on social issues. It has historically favored abortion rights and in 2010 enacted a law authorizing same-sex marriages.

Obama has made a special effort to reach out to women through advertising and grass-roots organizing. His appeals are reinforced by the symbolism of a state Democratic ticket headed by three women — Maggie Hassan, who is running to succeed the retiring Lynch against Republican Ovide M. Lamontagne; and Carol Shea-Porter and Ann McLane Kuster, who are challenging Republican Reps. Frank Guinta and Charlie Bass in the two congressional races.

Mitt Romney, however, could get caught in spillover from the state legislature’s conservative agenda after Republican lawmakers pushed a series of anti-abortion measures. Lynch vetoed or threatened to veto most of them. Obama alluded to the legislature in his remarks here, and Republicans acknowledge that it could be a factor in the presidential race.

Romney has many ties to New Hampshire, as a former governor of neighboring Massachusetts and as a summer resident with a home on Lake Winnipesaukee. Romney launched his campaign here in June 2011, and he turned the state into an early firewall in the Republican primary season, romping to victory.

The new presidential nominee then returned to launch his general election campaign. He hasn’t been in the state since September but is expected to visit again to make a final appeal to voters here.

New Hampshire’s role in electoral college calculations is secondary to that of Ohio, Virginia and Florida. But one particular election scenario is telling: If Romney can win those three states, along with North Carolina, he would need only New Hampshire’s four votes to win the White House if other states vote as predicted.

As in many battleground states, the outcome here could most depend on which campaign can turn out the most voters. Obama’s team started early to reassemble its grass-roots operation and now wins praise from state Democrats for that effort.

But Republicans say Romney’s team, in cooperation with the national and state GOP, is far ahead of what Sen. John McCain (R-Ariz.) did here four years ago. “The extent of the organization and voter contact for the Romney folks is just miles ahead of where McCain was,” said Fergus Cullen, a former state Republican Party chairman. “There’s just no comparison.”

Democratic Sen. Jeanne Shaheen, who attended Obama’s rally Thursday, said she believes that the president holds a small lead but that Democrats still have work to do. “It’s going to be close,” she said, “so we need to get people energized, we need to get people out on Election Day.”