Updated

New Hampshire set its earliest-ever presidential primary for Jan. 8 on Wednesday, maintaining the Granite State's first-in-the-nation status in a nominating process that has been mostly crammed into the first two months of 2008 .

Secretary of State William Gardner announced the date Wednesday, ending months of speculation, including the possibility that New Hampshire might push its primary into December in order to keep its spot first in the line. The date puts New Hampshire five days after Iowa's leadoff caucuses.

The primary often has shaped presidential contests — sometimes dramatically — for half a century. The date resulted from states around the country scheduling their own early primaries and caucuses to attract candidates before the major party nominees are chosen. As a result, both the Democratic and Republican nominees are likely to be effectively chosen by Feb. 5, when 22 states vote, if not earlier.

Gardner set New Hampshire's date hours after Michigan's Supreme Court said that state's primary could go forward as scheduled on Jan. 15, ending a court battle. New Hampshire waited to make sure Michigan wouldn't schedule caucuses even earlier.

Iowa's caucuses have led the way for several decades, but New Hampshire has had the initial primary for even longer, since 1920.

"This tradition has served our nation well, as decades of candidates and presidents have said," Gardner said.

New Hampshire stands to lose half of its delegates to the Republican convention, reducing the number to 12, because it moved earlier than party rules allow. But state officials are not concerned about that, considering it a small price to pay for the attention New Hampshire gets from its leadoff spot. Democratic rules allow New Hampshire to hold an early primary, so the state will keep all of its 30 delegates to the Democratic National Convention.

Presidential candidates were quick to praise the announcement, saying the state has kept its rightful role in the nominating process.

"The New Hampshire primary is critical because voters in New Hampshire take their responsibility seriously: they listen to the candidates, look them in the eye, ask them tough questions and size them up. In New Hampshire, ideas truly matter more than money and that is precisely why this is anyone's race," Democratic candidate John Edwards said in a statement.

Republican candidate Mitt Romney pledged to head off any negative fallout from the decision at the convention.

"It is good news that New Hampshire's traditional role in the process has been maintained," Romney said. "I will work to ensure that all New Hampshire's delegates are seated at the Convention."

In Michigan, the high court's decision should clear the way for both the Republican and Democratic parties to take part in the Jan. 15 primary. Both have already filed letters with the secretary of state saying that's their plan.

Click here to see the Michigan Supreme Court order on Grebner v. State of Michigan (.pdf).

However, by holding its primary so early — in violation of the national parties' rules — Michigan stands to lose half of its delegates to the Republican National Convention, reducing the number to 30, and all of its 156 delegates to the Democratic National Convention.

The national parties have imposed similar penalties on other states as party leaders have struggled to regain control of a chaotic nominating calendar.

If Michigan has its primary on Jan. 15, that would put it behind only Iowa's caucuses on Jan. 3, Wyoming's caucuses on Jan. 5 and New Hampshire's primary on Jan. 8.

Democrats in Michigan have kept open the possibility of picking their presidential favorite through a party caucus, even if the primary is held.

In its 4-3 decision Wednesday, the Michigan Supreme Court overturned lower court rulings that said the law setting up the primary was unconstitutional because it would let the state political parties keep track of voters' names and whether they took Democratic or GOP primary ballots but withhold that information from the public.

Michigan GOP Chairman Saul Anuzis said he was pleased the primary would be held and said Republicans would participate even if Democrats switched to a caucus.

"This is good for Michigan, this is good for Republicans and it's good for the process," he said.

Anuzis would like to see state House Democrats next week pass a bill that would restore the names of four Democratic presidential candidates who have withdrawn from the ballot. Barack Obama, John Edwards, Joe Biden and Bill Richardson pulled their names because the state violated Democratic National Committee rules by moving up the election.

A state Senate-passed bill would require all candidates' names to be on the ballot, although it also would give them the chance to withdraw again.

East Lansing political consultant Mark Grebner, one of several people who brought the suit arguing it was wrong to let only the political parties have access to the primary voter information, said he didn't plan to take any additional action at this point.

He doesn't object to the primary being held, but said other people should have access to the records because the information was obtained through an election paid for with public dollars. The circuit and appeals courts had agreed with his reasoning.

The Associated Press contributed to this report.