The two-year court battle over Arizona’s immigration law clearly benefited the bottom lines of three law firms.

Snell & Wilmer, Ballard Spahr and Bancroft collectively reaped nearly $3 million in legal fees for their work defending the state against three lawsuits as one legal challenge to the law made its way to the nation’s highest court, according to the Arizona Republic.

Arizona Governor Janice Brewer hired Snell & Wilmer to represent her office in a spate of civil suits filed in the wake of the law’s passage, which received a 5-2 split decision Monday from the U.S. Supreme Court.

The Phoenix-based Am Law 200 firm, which has so far earned roughly $2.3 million for its work defending the law against an initial challenge brought by the Justice Department, subsequently shifted its representation to Arizona Attorney General Tom Horne as the landmark case proceeded to the high Court.

Snell & Wilmer chairman John Bouma, a former adviser to U.S. Senator John McCain’s 2008 presidential campaign, told the Am Law Daily, a Daily Business Review affiliate, on Tuesday that he and a team of firm colleagues led by fellow litigation partner Robert Henry argued in favor of the bill at the federal district and appellate courts against both the Justice Department and civil rights groups.

Bouma called Monday’s Supreme Court decision “nothing unexpected.” He noted the majority opinion upheld a key component: the provision critics call “show me your papers,” which allows state and local law enforcement officials to check the immigration state of those they suspect of being in this country illegally.

Making Arizona’s case at the Supreme Court, meanwhile, was Bancroft partner Paul Clement. The former U.S. solicitor general joined the Washington-based boutique last year after noisily withdrawing from King & Spalding amid a flap over his representation of House Speaker John Boehner in defending the federal Defense of Marriage Act.

Arizona hired Clement last June to handle the state’s certiorari petition to the high court. His firm has received $400,000 so far for Clement’s efforts in the case, according to the Arizona Republic.

Ballard Spahr, which the Arizona Republic reports has been paid $36,000 in the litigation, hired Brewer’s former general counsel, Joseph Kanefield, as a litigation partner last year. The firm subsequently handled several amicus briefs while serving as coordinating counsel on other matters.