Sen. Kelly Ayotte is recovering from a case of Washington whiplash.

The New Hampshire Republican spent recent months under fire from the Left for voting against tougher gun-control regulations. Then, about two weeks ago, Ayotte announced her support for the Gang of Eight immigration reform package, and the attacks started all over again, but this time, from the Right.

In her Senate campaign, Ayotte ran largely on fiscal issues -- a major theme of the Tea Party-fueled 2010 midterm elections. Since assuming office, she also has taken a keen interest in national security matters. But careers on Capitol Hill tend to rise and fall not on policy positions, thoroughly researched and rehearsed in campaigns. More often, lawmakers are blindsided by politically messy issues that don't obviously lend themselves to their core principles.

Members of Congress who can navigate the political minefield of Washington lobbyists, voters back home and activist groups coming from every direction often do more than survive on Election Day: They become significant institutional players. The relatively inexperienced Ayotte, who represents the politically quirky home of the nation's first presidential primary, is a perfect test case of a politician in the midst of an uncertain transition from campaigner to lawmaker.

"Situations and facts that happen in our country do drive a lot of the discussion of what comes up -- and the order in which it comes up around here," Ayotte told the Washington Examiner just after voting to advance the Gang of Eight's immigration reform bill. "That's just something you have to adjust to as a legislator."

Politically, Ayotte's first stint as an elected official had been relatively smooth sailing prior to President Obama's push to expand the types of gun purchases subject to federal criminal background checks. The senator voted with the Democrats to allow a floor debate on a bipartisan compromise measure, but ultimately voted against the legislation. New Hampshire is a traditionally strong pro-Second Amendment state, but liberal Democrats were livid.

Ayotte weathered the storm of increased media scrutiny, combative town hall meetings and attack ads aired on Granite State television by New York Mayor Michael Bloomberg, a staunch gun-control advocate. Then Ayotte announced her support for the Gang of Eight immigration package on the eve of the bill hitting the Senate floor, before it had been amended to strengthen the border security provisions, and the cycle of scrutiny and criticism resumed -- this time from disillusioned conservatives.

For the former state attorney general who was appointed to that position by both Democratic and Republican governors, the Washington experience has been somewhat of a trial by fire. Ayotte's challenge has been to keep her Senate office focused on the substantive matters she cares most about -- the national debt, economic growth and national security -- while attending to the wedge issues that periodically occupy voters' attention and shape their opinions of lawmaker's leadership.

"I think because of her apolitical background, which is a strength, she doesn't have a natural base to organize and rally behind her and help move past these tough issues," a longtime New Hampshire Republican operative said.

Ayotte, 45, is the mother of two children ages 5 and 8. That has made her a rarity in a Senate Republican conference dominated by men, but also a valuable advisor and spokesperson for her GOP colleagues who want to connect their policies to the concerns of average Americans and improve their standing among women voters. But the senator is hardly a strategic political operator, say New Hampshire Republicans who have followed her career.

Ayotte agreed with that assessment, laughing that she would be "shocked" if anyone in New Hampshire viewed her that way. Her Republican supporters liken her to two independent-minded Republicans who preceded her: Warren Rudman and Judd Gregg, whom she succeeded. But these iconic New Hampshire lawmakers happened to serve at a time when the Granite State, with its healthy bloc of independent voters, leaned slightly more Republican than Democrat.

As it stands, Republicans haven't won New Hampshire's electoral votes since 2000, and Ayotte is currently both the only Republican statewide office-holder and the only GOP member of the state's four-person congressional delegation. Surviving these odds will require political skill, although it's Ayotte's everyday background, according to Republicans, that could give her the latitude to pursue her policy agenda without getting tripped up by difficult votes on issues like guns and immigration.

"She really isn't an operator at all," said Steve Duprey, a New Hampshire Republican operative and former state GOP chairman. "She's refreshing in that way and it's served her well."