PHOENIX — Former Rep. Gabrielle Giffords’ hand-picked Democratic candidate squared off Tuesday in a special House election in Arizona against the Republican she narrowly beat just months before she was shot. It was a hard-fought preview of the broader fall campaign to come.

Both the GOP and the Democrats were using the race to hone and test their political arguments for the November elections, when everything from the White House on down will be on the ballot.

Republicans, sensing a chance to capture the former congresswoman’s seat in southern Arizona, sought to make the contest a referendum on President Obama and his handling of the economy. They argued that Democrat Ron Barber, a former Giffords aide asked by the lawmaker to pursue the seat, would fall in line behind the White House.

Democrats, in turn, played to the senior vote by contending that Republican Jesse Kelly, who narrowly lost to Giffords in 2010, would not protect Medicare and Social Security.

The victor will complete the remainder of Giffords’ term. Both candidates are promising to run for a full term in the fall, setting up a possible November rematch in a redrawn district that is friendlier to Democrats.

Elsewhere Tuesday, Virginia, Maine, Nevada and South Carolina held primary elections – with most of those states choosing Senate nominees – as did North Dakota, where voters were also deciding whether to go along with the Legislature’s repeal of a law that required the University of North Dakota to use the Fighting Sioux nickname.

In Virginia, George Allen brushed aside three conservative Republican rivals in the Virginia primary. Allen’s victory set up a November clash with another former Virginia governor, Democrat Tim Kaine, in a campaign closely tied to the presidential race in a state both parties consider vital for victory.

In North Dakota, Rep. Rick Berg defeated businessman Duane Sand in the state’s Republican primary. Berg now faces Democrat Heidi Heitkamp in the November race to replace retiring Sen. Kent Conrad. The election is expected to play a critical role in determining which party controls the Senate next year.In Nevada, Republican Sen. Dean Heller and Democratic Rep. Shelley Berkley were expected to prevail with ease against a slate of political unknowns. Their fall race would be one of the most competitive in the country.

Of all the races Tuesday, the Arizona House race was the most closely watched, partly because of Giffords’ absorbing story and partly because holding onto the seat was important for Democrats if they want to regain control of the House.

The party needs big gains in November to grab the majority from Republicans, who now hold a 240-192 advantage with three vacancies, including Giffords’ seat.

Republicans, riding high after a decisive victory in Wisconsin’s gubernatorial election last Tuesday, set their sights on Arizona. A victory would give party leaders a chance to claim momentum five months before November and fine-tune their plan to link Democratic candidates to Obama, the incumbent at the top of the ticket.

Giffords, 42, resigned in January to concentrate on her recovery from a gunshot wound to her head. She and Barber were injured in the January 2011 shooting rampage outside a Tucson grocery store that killed six people. Giffords largely has shunned public appearances in the race, but in the closing days was stepping out to help Barber.

Outside groups have spent more than $2 million on the race.

Barber, 66, had a sizable fundraising lead in late May, but spending from conservative groups helped reduce the Democratic financial edge.

The Arizona 8th is a rare district that is competitive virtually every election. Giffords defeated Kelly by about 4,000 votes in 2010 when the election focused on immigration and when tea partyers rallied to the tough-talking former Marine. Now, the economy and jobs are voters’ top concerns.

Kelly, 30, spent the campaign arguing that Barber and Obama are out of touch with people in the district, where Republicans have a 26,000-person edge over Democrats in voter registration. He has called for lower taxes and more energy production as ways to improve the economy. And he has said he would roll back federal regulations and environmental protections in an effort to boost oil and gas drilling.

Barber spent the campaign trying to convince voters that he understands their concerns. He frequently talks about building up the solar industry and cutting taxes for the middle class. While Kelly has made it clear he would not support any income tax increases, Barber has said the wealthy need to “pay their fair share.”

Immigration is still an important issue. Kelly wants a double-layer fence built along the district’s border with Mexico. Barber is skeptical the fence would work on the district’s rugged terrain. He has called for more manpower, horse patrols and the use of drones.