While many of his colleagues — damaged politically by the budget impasse — were hesitant to share their positions, Maryland's only Republican in Congress knew he wouldn't be supporting the legislation his own party leadership was recommending.

And he wasn't afraid to say so.

"Yeah, I'm not voting for the bill," Harris, 56, said in the basement of the Capitol as fellow Republicans offered noncommittal responses to reporters. "It doesn't have any provision to reduce the debt and the deficit."

The budget battle that shuttered federal agencies for 16 days and brought the nation to the brink of defaulting on its debt obligations was, at its core, a fight between centrist Republicans and tea party conservatives. Even though he comes from one of the bluest states in the nation, the episode underscored that Harris is firmly at home with the conservatives.

The Johns Hopkins-trained physician represents a safe district for the GOP — made even more so by Democrats who redrew its boundaries in 2011.

"You cross over the Bay Bridge and, politically, it's a different world," said Todd Eberly, a political scientist at St. Mary's College. Harris' 1st Congressional District includes the Eastern Shore, as well as portions of Baltimore, Harford, Carroll and Cecil counties.

Political analysts say Harris' vote wasn't a surprise, pointing out he has long been to the right of Maryland's traditionally centrist Republican Party. From 1999 to 2011, when he served in the state Senate, he often opposed former Republican Gov. Robert L. Ehrlich Jr.

But they also note that Harris represents a district that looks different from the rest of Maryland — particularly after Gov. Martin O'Malley and other Democrats in Annapolis redrew the state's congressional map. In an effort to elect a Democrat in Western Maryland's 6th Congressional District, those devising the electoral maps moved precincts dominated by GOP voters into Harris' territory.

Though President Barack Obama captured 62 percent of Maryland's vote in the 2012 election, he won only 38 percent in the newly redrawn 1st District.

Harris "is more conservative than some of his constituents, but he's also got constituents who are to his right," said Diana Waterman, chairwoman of the Maryland Republican Party and a resident of Harris' district.

The old district was represented for 18 years by centrist Republican Wayne T. Gilchrest. Harris beat Gilchrest in the 2008 GOP primary but lost in the general election to Democrat Frank Kratovil. Harris ran again and won by 12 percentage points in the Republican wave year of 2010.

Because primaries in both parties tend to attract more ideological voters, it is smart politics for Harris to protect his right flank, experts say. So far, no GOP candidate has mounted a serious threat to him.

"The 1st Congressional District, by design of the Democratic General Assembly and the governor, is a conservative part of Maryland," Harris said in an interview. "By gerrymandering, it's now a match for where, traditionally and historically, I have always been."

Harris, an obstetric anesthesiologist who lives in Cockeysville, had a low-key first term. After winning re-election with 63 percent of vote in 2012, he has filed a half-dozen bills this year and was appointed to the powerful House Appropriations Committee.

An analysis of his voting by CQ Roll Call shows he sided with his party 95 percent of the time in 2012, up 4 percentage points from the year before. He has an 83 percent score from the conservative Heritage Action for America, compared to the 68 percent average for all House Republicans.

Yet Harris has spoken favorably of House Speaker John Boehner, even as many conservatives openly criticized him before the latest budget battle. At a town hall meeting in Bel Air in August, several voters pressed Harris on his allegiance to the beleaguered House Speaker.

"He gives up on everything," a voter shouted at Harris. "He's a Democrat."

"Speaker Boehner has a very hardjob. He's going up against the guy with the microphone," Harris responded, referring to Obama.

Boehner began looking for a way to end the government shutdown when polls indicated the public was blaming Republicans more than Democrats. The House Republican caucus, however, failed to agree on path forward. And so the agreement was crafted by Senate Majority Leader Harry Reid of Nevada and Senate Minority Leader Mitch McConnell of Kentucky.

On the House floor, 87 Republicans —including Boehner and other leaders — voted for the deal.Including Harris, 144 Republicans opposed it. The bill passed the House 285-144 and Obama signed it into law Thursday.

Democrats quickly lambasted House conservatives for their role in the budget debacle. Obama repeatedly called the tea party wing "extremists."

"It's shameful that Andy Harris voted against ending a reckless and unnecessary shutdown that had significant effects on Maryland's families," Bob Fenity, executive director of the Maryland Democratic Party, said. "The congressman continues to put the tea party above the people he is supposed to represent."

But given the political landscape in his district, Eberly said, Harris' positions make sense — even if they sometimes leave the state's liberal establishment confounded.

Harris has only to study his own path to power to foresee the potential for his own undoing.

He beat Gilchrest in the 2008 primary because conservative voters felt the incumbent was out of touch with their values.

"Harris' greatest concern when it comes to his electoral health isn't a general election," Eberly said. "It's a primary."