
527 F.3d 674 (2008)
Tony HANIG, Plaintiff-Appellant,
v.
CITY OF WINNER, South Dakota, Defendant-Appellee.
No. 07-2022.
United States Court of Appeals, Eighth Circuit.
Submitted: January 14, 2008.
Filed: June 4, 2008.
*675 Ronald A. Parsons, Jr., argued, Shannon R. Falon, Matthew T. Tobin, on the brief, Sioux Falls, SD, for appellant.
Michael A. Henderson, argued, Sioux Falls, SD, for appellee.
*676 Before LOKEN, Chief Judge, MURPHY, Circuit Judge, and JARVEY,[*] District Judge.
LOKEN, Chief Judge.
Tony Hanig applied to the City of Winner, South Dakota, for a liquor license for a proposed restaurant and lounge. The City Council unanimously denied the application after a public hearing at which a city building inspector advised that Hanig's site plan was inadequate and Hanig said he was not sure whether he would employ exotic dancers at the lounge. Hanig applied in state court for a writ of mandamus. The trial court denied relief, but the Supreme Court of South Dakota reversed, concluding that the Council had violated Hanig's due process right to a fair and impartial hearing because one Council member worked for a restaurant in Winner, and she neither recused nor abstained from voting after her employer expressed concern about Hanig's application. The Supreme Court remanded, instructing the trial court to issue a writ compelling the City Council to grant Hanig a second hearing. Hanig v. City of Winner, 692 N.W.2d 202 (S.D.2005).
On remand, Hanig did not pursue a second hearing, and his mandamus application was dismissed, without objection, on the City's motion to dismiss for lack of prosecution. Instead, Hanig filed this action under 42 U.S.C. § 1983 seeking damages and attorney's fees for the City's violation of his federal constitutional right to procedural due process.[1] The district court[2] held the action barred by the doctrine of res judicata because Hanig could have sought damages in his state court mandamus action. Hanig appeals. We affirm.
Under the Full Faith and Credit Statute, 28 U.S.C. § 1738, federal courts in § 1983 actions must "give preclusive effect to state-court judgments whenever the courts of the State from which the judgments emerged would do so." Allen v. McCurry, 449 U.S. 90, 96, 101 S.Ct. 411, 66 L.Ed.2d 308 (1980). Thus, the issue we must decide turns on the South Dakota law of issue and claim preclusion. See Medvick v. City of University City, 995 F.2d 857, 858 (8th Cir.), cert. denied, 510 U.S. 976, 114 S.Ct. 468, 126 L.Ed.2d 419 (1993). We review the district court's interpretation of South Dakota law de novo. Roeder v. Metropolitan Ins. & Annuity Co., 236 F.3d 433, 436 (8th Cir.2001).
Under South Dakota law, "res judicata bars an attempt to relitigate a prior determined cause of action.... The test for determining if both causes of action are the same is a query into whether the wrong sought to be redressed is the same in both actions." Bank of Hoven v. Rausch, 449 N.W.2d 263, 266 (S.D.1989). When the second action seeks redress for the same wrong, res judicata bars relitigation of a claim or an issue "actually litigated or which could have been properly raised and determined in a prior action." Black Hills Jewelry Mfg. Co. v. Felco Jewel Indus., Inc., 336 N.W.2d 153, 157 (S.D. 1983) (emphasis omitted). Like the district court, we have no doubt that the *677 Supreme Court of South Dakota would hold that the differences between mandamus and § 1983 actions are insufficient to prevent res judicata from barring § 1983 damage claims that could have been raised in a prior mandamus action. See Wozniak v. County of DuPage, 845 F.2d 677, 681 (7th Cir.1988) (applying Illinois law).
Even a cursory glance at Hanig's federal complaint shows that he is seeking redress for the same alleged wrong that was the subject of the state court mandamus proceedings. Indeed, the complaint alleged that the federal court should accord the Supreme Court of South Dakota's decision "controlling effect" on the issue of the City's liability. The only difference is that, having abandoned his claim for mandamus relief in state court, Hanig now seeks money damages. Damage claims would seem to fall within the res judicata bar of the prior action because South Dakota law expressly authorized Hanig to seek money damages in the mandamus proceeding. See S.D. Codified Laws § 21-29-12; Brown v. City of Yankton, 434 N.W.2d 376 (S.D.1989). However, Hanig argues that the damage claims are not precluded because his damages were unascertainable when he applied for the writ of mandamus. This contention requires a closer look at the mandamus relief he sought in state court and the injuries alleged in this action.
In his federal complaint, Hanig alleged that another bar opened in "direct competition with [his] proposed establishment" while he appealed the denial of mandamus relief to the South Dakota Supreme Court. Therefore, he alleged, the City's due process violation caused damages that included "lost profits, lost business revenue, lost business opportunity, [and] loss of income." These damage claims have as their unstated premise the notion that Hanig was entitled to a liquor license. Indeed, that was his initial claim in state court  he applied for a writ of mandamus that would compel the City to issue him a license. That claim, if successful, would have entitled him to seek an award of damages under S.D. Codified Laws § 21-29-12 for injuries caused by the delay in securing the judicially-compelled license. Although the amount of damages caused by the on-going delay was unknown when he applied for this writ, the fact that he was damaged by the denial of a liquor license was known, and it is not uncommon to defer the question of damages until the right to mandamus relief has been established, as in Brown, 434 N.W.2d at 377, and in Hillcrest Terrace Corp. v. Rapid City, 71 S.D. 291, 23 N.W.2d 793 (1946). See generally Nationwide Corp. v. N.W. Nat'l Life Ins. Co., 251 Minn. 255, 87 N.W.2d 671, 686 (1958).
However, Hanig abandoned his claim for a judicially-compelled license when he amended the mandamus application to seek only a writ compelling the City to grant him a second hearing. Any damages that could have been sought had the first claim been successful were abandoned as well. Accordingly, res judicata bars these damage claims.[3] We further note *678 that these claims are frivolous because the mandamus relief Hanig obtained  a second hearing  would not entitle him to damages premised upon the grant of a liquor license application he then abandoned.
There remain the claims for damages flowing from the mandamus relief Hanig did obtain  a second hearing on his liquor license application. As alleged in his federal complaint, these damages included "the constitutional violations themselves, attorneys' fees in vindicating his rights ... damage to reputation, emotional distress, and other consequential damages." These damages were known and ascertainable when the Supreme Court of South Dakota remanded the mandamus proceedings, and Hanig clearly could have sought damages as part of his relief in the trial court. See S.D. Codified Laws § 15-6-54(c) ("every final judgment shall grant the relief to which the party in whose favor it is rendered is entitled, even if the party has not demanded such relief in his pleadings"). Yet rather than seek an award of damages after the Supreme Court of South Dakota established his right to mandamus relief, Hanig filed a Response in the trial court stating that he did not object to the City's motion to dismiss the mandamus proceedings, explaining that "the renewed license was not worth getting" because, by the time he was awarded a fair and impartial hearing, "another bar opened right next to where Hanig wanted to use his liquor license." In these circumstances, a clearer case of damage claims that could have been raised, but instead were abandoned, is hard to imagine. Therefore, res judicata bars these claims as well.
In his reply brief, Hanig complains that the City should not be permitted to rely on res judicata because it failed to plead this affirmative defense and explicitly disclaimed the doctrine's applicability. However, the district court properly invoked res judicata to avoid "unnecessary judicial waste" and then gave Hanig ample opportunity to argue the issue. Arizona v. California, 530 U.S. 392, 412, 120 S.Ct. 2304, 147 L.Ed.2d 374 (2000) (quotations omitted); see Bechtold v. City of Rosemount, 104 F.3d 1062, 1068 (8th Cir.1997) (affirming on res judicata grounds sua sponte).
The judgment of the district court is affirmed.
NOTES
[*]  THE HONORABLE JOHN A. JARVEY, United States District Judge for the Southern District of Iowa, sitting by designation.
[1]  Hanig asserts that the South Dakota Supreme Court's decision conclusively established the City's § 1983 liability. However, that Court's majority opinion, like the parties' briefs, cited only state court decisions, and Article VI, § 2, of the South Dakota Constitution contains an independent due process guarantee.
[2]  The HONORABLE LAWRENCE L. PIERSOL, United States District Judge for the District of South Dakota.
[3]  In his reply brief, Hanig relies heavily on Creek v. Village of Westhaven, 80 F.3d 186, 190 (7th Cir. 1996), where the court stated in holding the second suit not barred: "You cannot split a claim into a request for damages and a request for injunction and litigate each in a separate suit .... provided that you can obtain both forms of relief in one suit." Creek is factually distinguishable for two reasons. First, when the injunctive relief was granted in Creek, plaintiff "could not estimate his full damages because he did not know when he would, at last, obtain the permit." Id. Here, on the other hand, Hanig's full damages from the delay in obtaining a liquor license would have been known at the time he was granted mandamus relief compelling the City to issue the license. Second, unlike this case, the damage claims in Creek were based in part on alleged wrongful acts committed after the first suit.
