In this action involving the alleged breach of oral agreements to sell real property and a mobile home, the trial court granted defendant’s motion to dismiss. Plaintiffs appeal, and we affirm.
The following undisputed facts are taken from plaintiffs’ complaint. Plaintiff Osborne was the proprietor of Quadco Rock and Paving and later the chief executive of plaintiff Quadco, Inc. During the 1990s, Osborne owed money to certain creditors, and, as stated in the complaint, he had “problems” and “issues” with those creditors. As a result, according to Osborne, he “could not own any property under his [own] name.” With those creditor obligations in mind, Osborne struck three oral agreements with defendant’s now deceased husband, Nottley.
The first oral agreement occurred in 1989. Nottley agreed to purchase a parcel of land from Osborne, with the deed registered in Nottley’s name. In return for serving as the title owner, Nottley was permitted to live on the property and use it for business purposes rent free. Once Osborne’s credit problems were rectified, Nottley would be required to transfer legal ownership to Osborne. Nottley subsequently made a down payment, for which he was later reimbursed by Osborne, who also made subsequent payments on the parcel as well as payments for maintenance and taxes.
Under the second oral agreement, which took place in 1993, Osborne purchased a mobile home to be titled in Nottley’s name. In exchange for serving as the title owner, Nottley was permitted to live in the mobile home rent free. Again, once Osborne’s credit problems were rectified, Nottley was to transfer legal ownership to Osborne.
The third oral agreement was a 1998 forbearance and security agreement. Aside from his other creditors, Osborne owed Nottley over $240,000. In exchange for Nottley’s promise not to bring collection proceedings against him and to provide collateral for that debt, Osborne incorporated Quadco Rock and Paving and issued 50 percent of the stock to Nottley. Osborne kept the rest of the stock in his own *204name. According to the agreement, even though shares were issued to him, Nottley would not be entitled to any income or dividends from the corporation; further, when Osborne’s credit problems were rectified and when the debt to Nottley was satisfied, Nottley would return his stock to Osborne.
In 2000, without Osborne’s knowledge, Nottley conveyed part of “bis” real property interest to his wife, defendant. Thereafter, in 2001, Osborne repaid Nottley in full and solved his creditor problems, but Nottley did not convey the real property or mobile home to Osborne. Nottley then died, leaving defendant as the record owner of the real property and mobile home. When she, like her husband before her, did not convey the properties to Osborne pursuant to the oral agreements, Osborne ejected her from the properties, leading to this litigation.
Plaintiffs sought to quiet title and a declaration that they were the owners of the real property and mobile home. They also asserted, in the alternative, a claim for unjust enrichment. In their first complaint, they alleged only that Nottley purchased the property and held it for him as a matter of “convenience purposes.” In response to defendant’s motion to make more definite and certain, plaintiffs’ second amended complaint used the phrase “creditor problems.” As noted above, the trial court dismissed the complaint on alternative bases: first, that plaintiffs failed to plead facts that, if true, would establish an exception to the statute of frauds; and second, that they requested relief in equity with unclean hands. Because we agree with the trial court’s application of the unclean hands doctrine, we affirm without considering whether the pleading was legally sufficient.
This action lies in equity. The declaratory judgment claim, although statutory, ORS 28.010, is equitable in nature because the relief sought is a declaration of equitable rights and the principles invoked are equitable in nature. See Ken Leahy Construction, Inc. v. Cascade General, Inc., 329 Or 566, 571, 994 P2d 112 (1999) (explaining when declaratory judgment proceedings lie in equity); Moon v. Moon, 140 Or App 402, 408, 914 P2d 1133, rev den, 323 Or 484 (1996) (quiet title action equitable in nature). Plaintiffs’ alternative claim for unjust enrichment is an equitable claim as well. Angelini *205v. Delaney, 156 Or App 293, 305, 966 P2d 223 (1998), rev den, 328 Or 594 (1999).
“[A party] who comes into equity must come with clean hands.” McKee v. Fields, 187 Or 323, 326, 210 P2d 115 (1949). “Unconscientious conduct by a party to a controversy, in respect of and connected with the matter in dispute, disqualifies such party from seeking the aid of a court of conscience.” Id. “ ‘The dirt upon his hands must be his bad conduct in the transaction complained of.’ ” North Pacific Lumber Co. v. Oliver, 286 Or 639, 652, 596 P2d 931 (1979) (quoting John Norton Pomeroy, 2 Equity Jurisprudence § 399, 96 (5th ed 1941)). The inequitable conduct need not rise to illegality, and it “may have as its target either the defendant or some third party.” Id. at 651. “The maxim is applied for the protection of the court and not for the benefit of the defendant, who may in fact be equally affected with the improper transaction,” id. at 650; thus, the trial court “may invoke the doctrine on its own motion,” Merimac Co. v. Portland Timber, 259 Or 573, 580, 488 P2d 465 (1971).
We conclude that the trial court correctly applied the unclean hands rule. Plaintiffs’ second amended complaint, elaborating on what their original complaint characterized as transactions designed for “convenience purposes,” alleged, and we take as true, that (1) Osborne owed money to creditors; (2) he had “problems” with those creditors; and (3) for that reason, he asked Nottley to serve as title owner of the properties; but (4) neither he nor Nottley intended the property to belong to Nottley; and (5) once the creditor problems were resolved, Nottley was obliged to return legal ownership of the properties to Osborne. Those bare allegations constitute plaintiffs’ acknowledgment that Osborne used Nottley to shelter property from people to whom Osborne owed money. If the properties were titled in Osborne’s name, they could have been seized, and the conclusion is inescapable that Osborne structured the transactions to avoid that eventuality.
A conveyance designed “for the purpose of placing property beyond the reach of creditors” constitutes inequitable conduct sufficient to bar relief under the unclean hands doctrine. Thompson v. Spint, 247 Or 484, 485, 430 P2d 1014 *206(1967); see also Reid v. Multnomah County, 100 Or 310, 327-28, 196 P 394 (1921) (administrator attempting to evade taxation on debt owed to estate by administrator committed inequitable actions that clouded title to encumbered property and barred him from asking equity court “to remove the cloud which his own act has cast”); Damerow Ford Co. v. Bradshaw, 128 Or App 606, 618-19, 876 P2d 788 (1994) (stock transactions that were “concealed” and “covered up,” adversely affecting purchaser of shares, were inequitable and barred wrongdoers from recovery). The “dirt upon” Osborne’s “hands” was inequitable conduct related directly to the subject of the litigation. In sum, the unclean hands doctrine warranted dismissal.
Affirmed.