Democrat Ron Barber, a former aide to Gabrielle Giffords who was injured in the shooting that nearly took the ex-Arizona congresswoman’s life, won the special election to replace her on Tuesday.

With 66 percent of precincts reporting, Barber led Republican Jesse Kelly 53 percent to 45 percent. The AP has called the race for Barber.

From left, former Rep. Gabrielle Giffords, Ron Barber and Mark Kelly, Giffords' husband, enter the polling place at St. Cyril's Catholic Church in Tucson, Ariz. Tuesday morning. (AP Photo/The Arizona Republic, Tom Tingle) (Tom Tingle/AP)

Giffords survived an assassination attempt in January 2011 and resigned her seat in Congress earlier this year to focus on her recovery. She supported Barber and campaigned on his behalf, but she played only a small role in the battle for a conservative-leaning southeastern Arizona district.

Instead, the race centered on Barber’s ties to the national Democratic Party and, more importantly, Kelly’s past statements about overhauling the nation’s entitlement programs, including Social Security and Medicare.

The Democratic strategy appeared to have paid dividends in what is a Republican-leaning district. Barber’s win comes mostly as a result of Democratic efforts to define Kelly early on as being anti-Medicare and anti-Social Security in the 11th-oldest district in the country. In their ads, Democrats ran footage and quotes of Kelly talking about getting rid of the entitlements.

Kelly attempted to distance himself from those past positions in this campaign, airing an ad featuring his grandfather and promising to protect the programs.

Given the large number of senior citizens in the district and Kelly’s past comments, though, the special election was almost a perfect test case for the Democrats’ strategy, which they used in previous special elections and plan to use in the fall.

The political circumstances are not likely to align so perfectly in most other districts, but Democrats point out that basically every GOP incumbent has voted for a Republican budget that overhauls Medicare and that they can use the issue against any number of Republicans, particularly incumbents, all across the country.

On the GOP side, the messaging was all about tying Barber to his national party, including President Obama and House Minority Leader Nancy Pelosi (D-Calif.), along with Obama’s health care law. Barber, much like his boss before him, sought to put some distance between his campaign and the president. Giffords, for example, notably declined to vote for Pelosi for speaker this Congress, after Democrats lost control of the House in the 2010 midterms.

Giffords played a bit part in the campaign, with Democrats featuring her in a piece of mail and a Democratic super PAC launching an ad that showed Kelly criticizing her during their 2010 campaign. She also appeared with Barber at a rally over the weekend. But in a district where more than half of voters were likely to vote by mail, many if not most ballots had already been cast.

The race didn’t attract as much attention and spending from outside groups as other recent special elections, despite indications that it would be close. Taking place just one week after the high-profile gubernatorial recall election in Wisconsin meant much of the nation’s attention was elsewhere until seven days ago.

Conservative groups and the national Republican Party spent about $1.4 million on Kelly’s behalf, while the Democratic Party and allied groups spent about $900,000 for Barber.

The contrast of the Wisconsin result, where the GOP held on in a tough state, with the Arizona result, where Democrats held a tough district, suggests neither side has the clear edge with less than five months until the 2012 election. Both races were their own unique sets of circumstances and can’t be ascribed to every race nationally.

Regardless of Tuesdays’s winner, the two could be headed for a rematch in November, where both candidates are running again for a full term in a newly-drawn district that will look different than the one they competed in Tuesday.

If Kelly loses, though, he could face a primary rematch with retired Air Force colonel Martha McSally, who finished in second place in the special election primary. The primary for the general election will be held Aug. 28.

Related: Arizonans head to the polls to fill Giffords’s seat