Plaintiff appeals from a trial court judgment dismissing his complaint. The parties had entered into a real estate joint venture agreement. After sale of the property, plaintiff sought to obtain a share of the joint venture assets. After a trial to the court in equity, his complaint was dismissed.
Plaintiff is a licensed real estate agent whose office is in Eugene. He had committed $20,000 toward acquisition of real property for a purchase price of $125,000 and was in jeopardy of forfeiting that sum if he could not secure another substantial investor. Through a third party, he approached defendant about the possibility of investing in the property. Thereafter, he and defendant entered into a joint venture agreement. The parties’ obligations were sketchily memorialized in a written agreement, wherein defendant agreed to invest $80,000 and plaintiff agreed to invest his $20,000 already committed to the property. The balance of the purchase price was secured by the parties’ $25,000 joint promissory note. Plaintiff was to refinance the property and pay defendant $100,000 within 60 days of the agreement, $80,000 being a return of defendant’s capital and $20,000 being applied toward a guaranteed profit of $27,000 to defendant. Plaintiff was responsible for making the installment payments due on the promissory note.
Plaintiff failed to refinance the property, to pay defendant in 60 days or to make the monthly installment payments on the note. When questioned by defendant, plaintiff first stated that he had made a few payments, but he later admitted that he had not made any of the installments. Defendant then had to bring the payments current to avoid foreclosure.
Plaintiff also was to make certain improvements to the property at his own expense, including new rugs and paneling. Although plaintiff did install some paneling, he defaced it by spot-staining it. He failed to install new' carpet, and defendant had to pay cleaning costs to make the old carpet presentable. Plaintiff also failed to maintain properly the grounds and the residence’s exterior.
The agreement also required plaintiff to make a balloon payment of $3,000 on the balance owed for the *599purchase price. Plaintiff did not do so, and defendant had to make that payment. Defendant also provided fire insurance, which by the terms of the agreement was plaintiffs responsibility. Because of plaintiffs neglect in attending to the property, defendant eventually had to assume responsibility for all the obligations, including installment payments, utility bills and all disbursements in connection with managing the property. Defendant received all rent receipts and handled the money received on the sale of the property. A final accounting presented by defendant at trial showed a projected profit of $16,295.27, of which $7,439.67 had been received. The balance was secured by trust deeds from the purchaser. By trial, plaintiff had not received any return of capital or profit.
Plaintiff first contends that each party to the venture should receive his initial investment before any profits be distributed to either party. In the absence of a contrary agreement, capital of the parties is repaid before profits. ORS 68.620; see also First Western Mortgage Co. v. Hotel Gearhart, Inc., 268 Or 613, 620, 522 P2d 881 (1974). The trial court concluded that the terms of the parties’ agreement provided that defendant receive both his $80,000 and his guaranteed return of $27,000 profit before plaintiff would receive any return of his capital. On de novo review, we find no reason to disturb that conclusion.
Granting that defendant was entitled to receive $80,000 plus the $27,000 guaranteed profit before plaintiff received any return of his capital, the question is whether the trial court properly excluded plaintiff from any distribution of funds in excess of $107,000. He contends that all funds received in excess of that must first be applied toward returning his $20,000 investment.
Ordinarily, a joint venturer who has contributed to the enterprise cannot be deprived of his share of the assets because of a failure to perform all of his duties under the joint venture, absent a claim of loss or damages resulting from his breach. Rayson v. Rush, 258 Or 315, 329, 483 P2d 73 (1971); McIver v. Norman, 187 Or 516, 540-42, 205 P2d 137, 213 P2d 144 (1949). As an affirmative defense, defendant contended that plaintiff should be excluded from distribution, because plaintiffs failure to complete his part *600of the agreement caused damage to defendant. The trial court acknowledged those damages and the imposition on defendant of the duties of managing the property, which were not part of the original joint venture agreement. Concluding that plaintiff had come into equity with “unclean hands,” the court held plaintiff was not entitled to equitable relief. The doctrine of “unclean hands” may be used to preclude a remedy to one who seeks equity but who has himself been guilty of inequitable conduct in his prior action related to the matters as to which he seeks relief. North Pacific Lbr. Co. v. Oliver, 286 Or 639, 596 P2d 931 (1979).
We conclude that the trial court correctly determined that defendant should receive the first $107,000 realized under the parties’ joint venture agreement. However, the trial court erred when it ruled that plaintiff was not entitled to equitable relief. Any additional net proceeds realized must be first distributed to plaintiff as a return of his capital investment. Defendant may set off any damages he has pleaded and proved against any net proceeds actually realized in excess of $107,000 to which plaintiff may be entitled.
Reversed and remanded.