BISMARCK, N.D. (AP) —Voters enjoying a robust economy fostered by western North Dakota's oil boom showed support Tuesday for the smaller government and tax cuts advocated by Republicans.

Led by Mitt Romney in the presidential race and Gov. Jack Dalrymple, the GOP won three of the top four races on the ballot, and Republican Rep. Rick Berg remained locked in a tight race with Democrat Heidi Heitkamp for the U.S. Senate.

Republican Kevin Cramer was elected to replace Berg in the U.S. House.

Voters said the strong GOP showing was a referendum not only on President Obama, but an endorsement of the GOP's handling of an oil boom that has enabled the state to defy a national economic slump.

The state's closely watched campaign turned into an early-morning nail biter as Heitkamp held onto an unofficial lead of fewer than 3,000 votes — a difference so small that The Associated Press did not call the race.

The margin is close enough that her opponent, Republican Rep. Rick Berg, can demand a recount. He declined to concede Wednesday, saying in a statement that he'd wait until the state counted each ballot and officially certified the result. That process could take a week.

Even Heitkamp's strong showing was something of a rejection of Democratic President Barack Obama: Heitkamp has been harshly critical of the president's energy policy, is pro-oil and supports gun rights. Despite the Democratic label, many viewed the 57-year-old former state tax commissioner and attorney general as more moderate than Democratic.

"I think she supports North Dakota better. She understands North Dakota and the way we live up here," said Willy Marler, 19, of Rogers, who voted for Mitt Romney as president but Heitkamp for Senate.

A Heitkamp victory would mean the Senate seat stays in Democratic hands. Berg and Heitkamp were competing to succeed Democrat Kent Conrad, who is retiring after 26 years in office.

Only two years ago, the state's congressional delegation had been entirely Democratic. But then Berg defeated longtime Democratic Rep. Earl Pomeroy, and Democratic Sen. Byron Dorgan retired and was replaced by Republican John Hoeven. Many predicted the entire delegation would be Republican after this election. The GOP had counted on a Berg victory as part of its failed effort to take control of the Senate.

If Heitkamp wins, she'll also be the first woman elected to represent North Dakota in either the U.S. Senate or House. Jocelyn Burdick briefly served in the Senate after her husband, Democrat Quentin Burdick, died in September 1992, but she was appointed by then-Democratic Gov. George Sinner.

Energy issues and the state's oil development were top issues in many North Dakota races. The state has risen from the nation's ninth-leading oil producer to No. 2 behind Texas in just six years, with the oil industry adding thousands of jobs and hundreds of millions of dollars to the state economy. It's put the state in a unique position, with a projected $1.6 billion in surplus money, while most states are drowning in debt.

While Berg had been considered the favorite in what would become the most expensive Senate race in state history, Heitkamp gained ground by focusing much of her campaign on local issues, including expanding North Dakota's oil refining capacity. The tide slowly turned, and Heitkamp, who was in her sixth statewide campaign and had strong personal popularity, seemed to attract voters who wanted someone more moderate in the post.

"I don't think we can trust (U.S. Senate candidate) Rick Berg to do what's best for North Dakota. I think he will do whatever the Republicans want him to do," said Sara Kincaid, a 34-year-old substitute teacher in Bismarck. "I think Heidi will do what's best for North Dakota and think she tends to be more independent and won't vote along party lines."

Nationally, "it is becoming too big government, too socialistic, too high taxes, less and less personal rights, less and less constitution, less and less everything," said Mark Nettum, 70, a retiree from Fargo who voted Republican across the board.

Tom Shockman, a Fargo money manager, voted straight Republican, too. The 50-year-old said he favors smaller government and thinks it has grown too big under Obama.

"That's how the founders built it. They wanted control with the states," Shockman said. "They didn't want a big centralized government, that's where they came from."

North Dakota has risen from the nation's ninth-leading oil producer to No. 2 behind Texas in just six years, with the oil industry adding thousands of jobs and hundreds of millions of dollars to the state economy. It's put the state in a unique position, with a projected $1.6 billion in surplus money, while most states are drowning in debt.

The governor's race focused on management of that growth, with Dalrymple maintaining he's done a good job of balancing spending on public works with tax cuts and Democratic challenger Ryan Taylor saying the state could do more to help local governments deal with problems created by oil-related development.

Dalrymple said his victory shows that citizens agree with his plan for improving the state's infrastructure, lowering taxes and maintaining fiscal responsibility.

"There's a whole different set of challenges when your state is doing well," the governor said. "Some of these judgment calls can get even more challenging. But we look forward to it, because so many things are going to become possible."Other voters decided to buck the Republican tide, as evidenced by Heitkamp's strong showing in the U.S. Senate race.

Carol Preston, 77, a Fargo retiree, said she voted for Green Party candidate Jill Stein for president and Heitkamp for Senate because she believes people in the highest income bracket should be paying more taxes. But Preston also voted for Dalrymple.

Willy Marler, 19, of Rogers, said he voted for Romney because he believes he'll do a better job on farm policy, but he also picked Heitkamp over Berg.

"I think she supports North Dakota better. She understands North Dakota and the way we live up here," Marler said. "It's a lot different from New York City or Los Angeles."

North Dakota residents approved four of five ballot measures. They agreed to expand the state's smoking ban to cover bars and other public places, prohibit the state from levying a tax on voting, protect farmers' rights, and require the governor and other elected officials to take an oath of office. Voters rejected a measure expanding the state's animal cruelty law.

More people were expected at the polls this year because the state's population has grown with the oil boom. Residents broke a record for early voting, with nearly 130,000 casting ballots before the polls opened on Election Day, Secretary of State Al Jaeger said. That broke the record set in 2008 by about 10,000 votes.

Still, Jaeger said he expected voter turnout in the state to be similar to what it was in the presidential elections four years ago and eight years ago - about 64 percent or 65 percent of eligible voters.

"Even though our numbers go up, will the (turnout) percentage go up? That remains to be seen," Jaeger said.

___

Associated Press writers James MacPherson and Blake Nicholson contributed to this report.

Alexander Andresian, center, weeps as President Obama is declared the winner on election night during the Nevada State Democratic Party gathering at the Mandalay Bay Resort and Casino in Las Vegas. John Gurzinski, AP

Bill Purcell votes at the Centerville Fire Station in Centerville, Idaho. The economy was his big concern as he cast his vote. "I think it needs to be overhauled. I think a new president would help," he says. Katherine Jones, The Idaho Statesman via AP

Sheresa Walker uses a flashlight as poll worker Lloyd Edwards assists before voting in a makeshift tent set up as a polling place at Scholars' Academy, PS 180, in the Rockaway neighborhood in the Queens borough of New York City. Mario Tama ,Getty Images

New York City firefighter Terence O'Donnell stands on sand among voting machines as he prepares to vote in a makeshift tent set up as a polling place at Scholars' Academy, PS 180, in the Rockaway neighborhood in the Queens borough of New York City. Mario Tama, Getty Images

Hundreds of people wait in line to vote at Green Run High School in Virginia Beach. Some people had to wait longer than four hours to cast their vote at the school. Ross Taylor, The Virginian-Pilot via AP

Sen. Amy Klobuchar, D-Minn., left, laughs as she joins her husband John Bessler, not shown, and daughter Abigail Klobuchar Bessler to cast her vote at the Marcy School in Minneapolis. Elizabeth Flores, The Star Tribune via AP

Assistant election officer Belinda Strickland, left, assists a voter who had a problem with a change of address at precinct 613 Westgate at Washington Mill Elementary School In Fairfax County, Va. J. Scott Applewhite, AP

Election workers Ann Marut, left, and Phyllis Gubitosi wrap themselves in blankets to keep warm while working at a polling station at Silver Bay Elementary School in Toms River, N.J. Andrew Burton, Getty Images

Evelyn Dennis prepares to hang an American flag as election workers set up voting booths at Memorial Elementary School on Nov. 6 in Little Ferry, N.J. The school is hosting all voting districts in the area because most of the town is still without power after Hurricane Sandy. Julio Cortez, AP

A clerk tabulates ballots at a polling station just after midnight on Nov. 6 in Dixville Notch, N.H., which bills itself as "First in the Nation" on Election Day. Each candidate received five votes, the first tie in Dixville Notch history. Rogerio Barbosa, AFP/Getty Images