On one side of the river, there’s an aggressive, ambitious attorney general of the state’s dominant political party who aspires to be governor.

On the other side, there’s, well, exactly the same thing.

So perhaps it is not surprising that on the important social issues that came before the Supreme Court this term, Maryland’s Democratic Attorney General Douglas F. Gansler and Virginia Republican Ken Cuccinelli II took opposite paths.

Their positions before the high court point out not only the competing legal philosophies of the two, but they also highlight what makes for good politics in the two states that surround Washington.

“The Potomac is wider than it looks on legal matters,” Cuccinelli said in an interview last week.

Virginia Attorney General Ken Cuccinelli, left, gestures during a press conference as the Bedford County sheriff, Maj. Ricky Gardner, right, listens in Richmond, Va., Thursday, April 5, 2012. (Steve Helber/Associated Press)

Gansler, the incoming president of the National Association of Attorneys General, plays down the differences — but not without a passing shot at his counterpart in Richmond.

“This term, there were eight cases in which both Maryland and Virginia both filed amicus briefs, and we were on the same side on all of them, except for the two cases where Virginia was trying to make a political point,” Gansler said.

Those two, of course, were the court’s biggest cases — the constitutionality of President Obama’s health-care law and the administration’s challenge of Arizona’s attempt to play a bigger role in the apprehension of illegal immigrants.

Cuccinelli’s role in the health-care litigation is well-known. He raced to the courthouse to challenge the law literally in the moments after Obama signed it. The U.S. Court of Appeals for the 4th Circuit in Richmond ultimately ruled against Virginia’s claim, and when the time came for the Supreme Court to decide which of the many challenges to the health-care law it would hear, it chose one mounted by Florida and 25 other states.

Cuccinelli in an amicus brief pursued his argument that Congress “took no hard look at its own authority” to pass the Patient Protection and Affordable Care Act.

“The sheer novelty of Congress’s claim to a power, unlimited in principle, to require a citizen to purchase a good or service from another gives rise to a negative presumption that no such power exists,” Cuccinelli wrote.

Gansler led the effort by other states — including California and New York — and the District of Columbia to convince the justices to let the law stand.

Those governments, Gansler wrote, “have each made determined efforts to address the extraordinary problems associated with the current system of health-care delivery in the United States.”

He said the attempts have led to the conclusion that states “cannot fully counteract the force of inexorable national trends driven by problems that are fundamentally interstate in nature. The experience . . . demonstrates the need for action on the national level.”

A similar philosophy shows in the immigration case. Virginia banded with other states in supporting Arizona’s law, which, among other things, requires law enforcement officers to detain anyone reasonably suspected of being in the country illegally. The Obama administration sued to have the law blocked before it could go into effect, saying such decisions are preempted by the federal government’s control of immigration policy.

“It would be exceedingly strange for Congress to set up a system allowing state participation in the enforcement of federal law, but then deny local law enforcement the power to conduct arrests,” said the brief joined by Virginia.

Maryland agreed with other states that “the singular question of whether and how to remove undocumented immigrants is one that is committed to the federal government.”

Cuccinelli said that Maryland sometimes baffles him. “I don’t understand liberal attorneys general coming in to undermine state prerogatives,” he said.

Gansler laments that there is a new partisan tone to the positions taken by the attorneys general that prevent a more unified voice for the states.

But, as Gansler noted, there is often agreement. Attorneys general defend successful prosecutions in their states, and so they usually are united in cases before the court that would expend the options of criminal defendants.

The only case Gansler has argued before the high court resulted in a unanimous decision reinstating the conviction of a man who had confessed to a molestation charge while in prison on other charges. Virginia supported Maryland’s position.

And both are happy that while the attorney general takes a back seat to the governor on most issues, they are in charge when it comes to their state’s position at the Supreme Court.

That means each has leeway not only in the position the state takes on cases argued before the court, but in encouraging the justices to either accept or reject certain appeals. Cuccinelli acknowledges an interest in a “niche” of cases, such as church and state issues, beyond the specific interests of the commonwealth.

“The attorney general speaks for the state,” is how Gansler puts it.

Cuccinelli is a bit more forceful: “I am Virginia for legal matters.”

For previous High Court columns, go to postpolitics.com.