Two of Maryland’s smartest politicians — both of whom happen to be dyed-in-the-wool Montgomery County liberals — stuck their necks out for gay rights last week.

Should they be congratulated or criticized? Did they do the Democratic Party any favors? And did they actually help themselves — and the causes they were trying to promote?

On its face, Attorney General Doug Gansler’s (D) opinion that Maryland should recognize gay marriages performed in other states seemed reasonable and well thought out — and it was the right thing to do. And Gansler surely anticipated the predictable uproar that followed from conservative groups and politicians — even the call for his impeachment from state Del. Don Dwyer, a Republican from Anne Arundel County.

But along with the criticism — and the applause from liberals and civil rights groups — Gansler probably didn’t anticipate the low groan from some Democratic leaders and legislators in Annapolis. Was halfway through the General Assembly session, in an election year, when Republicans and conservatives seem to be on the rise all across the nation, really the best time to be weighing in on such a divisive issue? Was stirring up social conservatives in the Democratic Party’s best interests?

Gansler himself won’t have to worry about re-election this fall — at the moment, he doesn’t have a single challenger, and even the full fury of the far right isn’t going to damage him this time around. But several Democrats, from Gov. Martin O’Malley to legislators in places like Baltimore and Anne Arundel counties and Southern Maryland, have to fend off cranky voters at a time when Republicans — despite the thoroughly disorganized Maryland GOP — by and large are energized, while the Democrats aren’t.

With his gay rights opinion, Gansler may have handed Republicans just a little more ammunition. Does Sen. Ed DeGrange (D) of Anne Arundel County really want to have to talk about gay rights — let alone explain or defend Gansler’s decision? Does Del. John Bohanan (D) of St. Mary’s County?

Former Gov. Bob Ehrlich (R), whose intention to try to get his job back is now the worst-kept secret in town, has already signaled how he plans to handle the gay rights issue with his op ed piece in Sunday’s Washington Post. A social moderate, Ehrlich blasted Gansler’s decision not because it advanced the cause of gay rights, but because he said it epitomized Democrats’ overreaching in Annapolis (an argument that Republicans have consistently used to great effect against President Barack Obama).

But Ehrlich doesn’t have to do any tub-thumping on the issue. If conservatives are riled up, he’ll benefit, plain and simple. So will Republicans up and down the ballot.

Gansler’s decision may endear him to the Democratic base in four years, when he presumably will be running for governor. But even then, it could weaken him if he becomes the Democratic nominee and he finds himself in a tough general election. Gay marriage could serve as another reminder to a certain set of voters of why they dislike Montgomery County liberals.

But if Gansler’s decision was controversial and carried political risks, at least he was fulfilling his duty as the state’s top legal officer, after being asked to render an opinion. What, then, are we to make of Montgomery County state Sen. Richard Madaleno’s (D) decision to write to Northrop Grumman officials, urging them to relocate their corporate headquarters to Maryland rather than Virginia because the Old Dominion is less friendly to gay couples than Maryland is? It was either really brilliant or really stupid.

Wherever Northrop Grumman lands in the D.C. area will largely be a function of how much money the defense contractor is able to shake down from the winning jurisdiction.

Still, if Northrop Grumman — which has an admirable policy of extending benefits to its employees’ same-sex partners — decides to move to Maryland, then Madaleno, the only openly gay member of the state Senate, can share in the credit, whether he deserves to or not. But if the company winds up in Virginia — even assuming its reasons for doing so are purely financial — then some critics will inevitably fault Madaleno for injecting social issues into a discussion about economic development.

Madaleno, who represents one of the two or three most liberal districts in the state, and who originally asked Gansler to weigh in on the same-sex marriage question, will not suffer any political consequences for penning (and publicizing) the Northrop Grumman letter. He’s courageously tangled many times with right-wingers over the issue of gay rights. But if Maryland loses the Northrop Grumman sweepstakes to Virginia and even one bigot blames it on Madaleno’s advocacy, has he unwittingly set back the cause?

Madaleno is nothing if not canny. By pointing out that one of the country’s biggest corporations is way ahead of state government on the question of benefits for same-sex partners, he is, indirectly, shaming his colleagues into thinking differently on the topic. Which may have long-term benefits — even if the Democrats suffer at the polls this time.

Josh Kurtz is senior editor at Roll Call, a Capitol Hill newspaper. He can be reached at .

Previous Center Maryland columns by Josh Kurtz:

The Washington Post Goes to War

Snow Job

Unsolicited Advice for Ehrlich — Wait Till 2014

The Early Bird Gets the Worm?

Wayne's World May Be Another Planet

Miller Time Comes Early

Owings Owes an Explanation