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.