Updated

New Hampshire has certified former state Attorney General Kelly Ayotte as the winner of the Republican primary for U.S. Senate.

Ayotte was endorsed by former Alaska Gov. Sarah Palin and won a narrow victory over Ovide Lamontagne. His conservative credentials and courting of the tea party pulled him close in the final days of the campaign.

Lamontagne has until 5 p.m. to decide whether he'll seek a recount because the margin of victory fell within 1.5 percent of the total votes cast.

The secretary of state's office says Ayotte's official margin of victory was 1,667 votes.

Ayotte will face U.S. Rep. Paul Hodes, who was unopposed in the Democratic primary.