The Maryland congressman challenging the District’s new marijuana-decriminalization law is no stranger to unpopular stances, having survived a contentious 12 years as a Republican lawmaker in the state’s Democratic-dominated General Assembly.

During last fall’s budget standoff, Rep. Andy Harris was one of the last true believers, continuing to vote against the federal budget even at the risk of prolonging a government shutdown. He equates mandated insurance coverage of contraception with the burning of churches and medical use of marijuana with telling patients to chew on mold instead of taking penicillin.

As a state senator in 2008, Harris tried to withhold funding to the University of Maryland because students planned to screen an X-rated film. He said he considers pornography “poison.”

“In modern government, policy follows the money sometimes,” Harris said of the threat, which prompted the university to address the public viewing of porn. “All that I wanted to do was highlight this issue and then get it fixed.”

His style is acerbic, his critics are many. But Harris’s friends and allies describe him as a dedicated father and Catholic with a fierce sense of moral obligation who is often unfairly typecast as an unreasonable tea partyer.

Harris, 57, says he enjoys collaborating with Democrats, especially on health policy — although he fiercely opposes the full Affordable Care Act. He says he is uninterested in political maneuvering — although his publicity-generating stances have helped him climb the political ranks.

Elected to Congress in 2010, he made it onto the powerful Appropriations Committee last year. Now he wants to chair the conservative Republican Study Committee, which could be a launching pad to higher leadership positions.

Appropriations has some power over the District’s budget, which meant that Harris could introduce an amendment in late June that would essentially bar the city from using taxpayer funds to decriminalize the possession of small amounts of pot. The amendment, called a rider, was approved by the committee and attached to a federal spending measure that is expected to go to the full House for a vote this month. The Senate would have to agree to the rider, which it is not expected to do. (Harris also attached a rider to the budget that could limit access to abortion.)

Harris said his chief concern about the law passed by the D.C. Council is that it does not treat teenagers caught with marijuana significantly differently from adults and does not refer them for treatment. In Maryland, where lawmakers also recently approved decriminalization, those younger than 21 have to appear in court.

“It’s potent stuff,” he said of pot. “It’s poison to a teenager’s brain.”

Harris frequently mentions that he is a physician, an anesthesiologist who specializes in obstetrics and practiced at Johns Hopkins University. A white lab coat hangs in his office waiting room. A stethoscope rests on his desk.

“I saw personally, firsthand, what drug use and drug abuse is doing to an underprivileged population,” Harris said of his time practicing in Baltimore.

Such comments infuriate D.C. leaders, who have long chafed at congressional interference in what they say should be local affairs.

“If he wants a free ride — a free propaganda ride, a free messaging ride — on the backs of African American youth in my city, well, he’s going to hear from me,” said Del. Eleanor Holmes Norton (D), the District’s nonvoting representative in Congress.

When the activist group D.C. Vote tried to pressure Harris by calling for a boycott of beaches in his district, including Ocean City, Harris shrugged off the threat.

D.C. residents “love coming to the Eastern Shore,” he said on July 3 on WTTG (Channel 5). “We don’t have the kind of drug-abuse problem that D.C. has. We don’t have the kind of crime problem that D.C. has.”

Advocates of decriminalization call it an act of social justice, pointing out that African Americans account for nine of 10 possession arrests in the District even though studies have shown that blacks and whites use the drug at about the same rates. Harris said that D.C. officials decide whom to arrest and how to prosecute them and that he considers decriminalization a step toward full legalization.

“This is astounding to me, to go and say that somehow this is a problem that is due to white guys,” he said. “I don’t get it.”

Harris represents Maryland’s 1st Congressional District, which includes the Eastern Shore and sections of Baltimore, Harford and Carroll counties. The district has been reshaped several times to make Maryland’s other seven U.S. House districts safer for Democrats, leaving Harris as the state’s lone Republican congressman.

He commutes to Capitol Hill from his home in Cockeysville, north of Baltimore, leaving at 5:45 a.m. to beat the traffic. When votes go late, he sleeps in his office.

Harris traces his political identity to his parents. His father, a dentist from Hungary who spent time in a Russian gulag for being anti-Communist, met his Ukrainian mother at a displacement camp. They immigrated to New York, arriving with just a suitcase, and raised four boys in Queens.

Harris attended medical school at Johns Hopkins and never really left, eventually studying health policy and also serving as a Navy Reserve medical officer. He decided to enter politics after realizing that state Senate Minority Leader F. Vernon Boozer (R-Baltimore County) faced no primary or general election opponent in 1994.

“That’s the way the elections were in the countries where my parents came from,” Harris said — a lack of competition with no opportunity for dissent. So Harris ran against Boozer in the 1998 primary and won.

In Annapolis, Harris worked on health legislation, gave dramatic floor speeches and became minority whip. But as one of a few Republicans, he found it exceedingly difficult to get things done.

In 2008, he challenged Rep. Wayne T. Gilchrest, a moderate Republican who often voted with Democrats. After Harris won the primary, Gilchrest backed his Democratic opponent, Frank M. Kratovil Jr. — who beat Harris in the general election by about 3,000 votes.

“This is not a liberal district,” Harris said. “This is a typical rural, deep-suburban district that’s right of center. . . . I was a much better match.”

Harris defeated Kratovil in 2010 and was reelected to Congress in 2012 after his Democratic opponent dropped out amid allegations of voter fraud. This fall, Harris will face Bill Tilghman, a retired lawyer and businessman who considers himself a centrist more than a Democrat.

Democratics’ dominance of the District’s government frustrates Harris in the same way their dominance of the Maryland General Assembly once did.

“If this Republican’s input is going to result in a slightly better outcome in the end,” Harris said of the decriminalization rider, “then that’s actually a good legislative result.”