
169 N.W.2d 228 (1969)
Mary PETERSEN, individually, and as Admrx. of Estate of Donald Dorwood Petersen, deceased, Respondent,
v.
William PETERSEN, Appellant.
No. 41632.
Supreme Court of Minnesota.
June 20, 1969.
*229 Rietz, Rietz & Rietz, Owatonna, for appellant.
Seifert, Johnson, Hand & Berens, Fairmont, for respondent.
Heard before KNUTSON, C. J., and NELSON, MURPHY, OTIS, and FRANK T. GALLAGHER, JJ.

OPINION
FRANK T. GALLAGHER, Justice.
Appeal by defendant from a judgment in favor of plaintiff entered in the district court following a trial before the court without a jury.
This case arose out of a dispute between the estate of a deceased partner and the surviving partner over the distribution of the assets of the partnership following dissolution on the death of the deceased partner.
Donald Petersen returned home from the service in 1946 and in May of that year joined his father, William Petersen, in a chicken hatchery business. Prior to that time, William had operated the business as a sole proprietorship. When the partnership was formed, William contributed the assets of the proprietorship, which included cash, machinery and equipment, inventory, and accounts receivable, having a total value of $41,000. Donald contributed nothing. From that time until Donald's death on October 2, 1964, the business continued to operate as a partnership. Donald in effect took over the operation of the hatchery, and William played a decreasing role in the business, simply helping out when called upon.
During the intervening years the taxes, upkeep, and improvements on the property contributed by William were paid out of partnership funds. The depreciation on the building and equipment was deducted on the partnership tax returns and the net income was split 50-50 between William and Donald. However, the property contributed by William remained in his name. William testified at trial that he had made a will in which he left all of the property used in the partnership to Donald.
In July 1963 Donald married for the second time, his first wife having died some years before. Defendant testified that he did not care for Donald's second wife. At his death, Donald left his wife, who is the present plaintiff, a son by his first wife, and *230 a daughter born of the second marriage. In July 1964 he had taken a fishing trip to Canada with his father and brother. Before leaving, he prepared a list of assets he claimed to own on hatchery account paper which he gave to plaintiff in case anything should happen to him. That list was introduced without objection at trial and included half of the assets of the hatchery business.
Following Donald's death, William went to Maylon Muir, who had been the attorney for the hatchery and was probating the estate. He asked Muir to prepare a letter to be sent out by the hatchery in order to get the accounts receivable paid up and indicated that half of them belonged to Donald. William hired a girl to work with him in getting copies of this letter out. The letter stated that the law required that all accounts be paid in order to wind up the affairs of Donald's estate. Muir testified that after most of the collections had been made, William indicated that he was not going to give any of the assets to plaintiff as he needed the money to meet bills in connection with his wife's illness. As a result of this refusal, plaintiff brought the present action to compel a division of the partnership assets.
The total value of the partnership property at the time of Donald's death, as established by testimony or stipulation, was $18,572.89. William based his claim to the full amount on the theory that he was entitled to the return of his capital investment before Donald's estate could recover anything. Since he had contributed $41,000 in capital, this obviously included all the partnership assets. Plaintiff contended, and the trial court found, that the conduct of the parties established an agreement for an equal division of the total assets of the partnership without a prior return of capital to William. It is from the judgment entered on the basis of this finding that William appeals.
Defendant states three separate issues, but they are simply parts of the real issue raised: Whether the trial court erred in ordering the total assets of the partnership divided equally between plaintiff (on behalf of Donald's estate) and defendant.
The law in Minnesota on the distribution of partnership property upon dissolution of the partnership is governed by Minn.St. 323.39, part of the Uniform Partnership Act, which establishes the following priority: (1) Payment of debts to creditors other than partners; (2) payment of debts to partners for other than capital contributions; (3) payment to partners for capital contributions; and (4) payment to partners of their share of the profits. It is established beyond question in this state, as elsewhere, that the capital contributed by a partner is a debt of the partnership which must be paid after the outside creditors but before there is any division of the profits. Burnett v. Hopwood, 187 Minn. 7, 244 N.W. 254; Hunter v. Allen, 174 Or. 261, 147 P. 2d 213, dismissed, except as to cross-appeal, on jurisdictional grounds, 174 Or. 286, 148 P.2d 936; 14 Dunnell, Dig. (3 ed.) § 7401; 2 Barrett & Seago, Partners and Partnerships Law and Taxation, c. 9, § 3. However, the above-cited authorities, including § 323.39, make it equally clear that the right of a partner to receive back the capital he contributed is subject to a contrary agreement among the partners. Before setting out the rules for distribution of assets, § 323.39 provides:
"In settling accounts between the partners after dissolution, the following rules shall be observed, subject to any agreement to the contrary * * *." (Italics supplied.)
It is also clear from past cases that a contrary agreement of the type referred to above need not be in writing. Where it is not written it is in effect an implied-in-fact contract and may be established in the same manner as any other such contract. Balafas v. Balafas, 263 Minn. 267, 117 N.W.2d 20. Thus, in the present case, since no part of the partnership agreement is in writing, the question is whether the trial *231 court erred in concluding from the conduct of the parties that there was an agreement between Donald and William that in the event of dissolution the assets of the partnership were to be divided equally between them without a prior repayment of the capital contributed by William.
Because the issue is primarily one of fact, Balafas v. Balafas, supra, the usual rules governing review of questions of fact apply: The evidence must be viewed in the light most favorable to the prevailing party, and the determination of the trier of fact can be set aside only if it is manifestly contrary to the evidence. In this case the trial judge has provided a memorandum setting out the facts and law relied on in reaching his decision. According to that memorandum, he based his decision on the following facts, all of which are supported in the record:
(1) The capital contributed by William was listed on the partnership tax returns and all depreciation was taken on those returns;
(2) All taxes on the property as well as repairs and improvements were paid out of partnership funds;
(3) The list prepared by Donald 3 months before his death included one-half the partnership assets as part of what he believed to be his property;
(4) The conduct of defendant before and immediately after Donald's death tends to support plaintiff's claim (referring in part to his action in sending out the letter of collection);
(5) The fondness William showed for his son as evidenced by his demonstrated intent to leave all the assets to Donald. (William testified that his will so provided.)
Viewing the record as a whole, it would seem that the conclusion of the trial court is adequately supported by the evidence. While the deceased did not contribute any capital to the business, for all but the very early years of the partnership, he operated it with very little help from his father. Although contributing nothing more than occasional assistance during this period, William continued to receive half of the income. The conduct of the parties makes it entirely reasonable to infer that William put up the capital and Donald provided the labor under an agreement by which each was to own half of the business, including both capital and profits.
Affirmed.
