
596 So.2d 423 (1992)
Ex parte Sam L. DIAMOND.
(Re Jake F. ARONOV and Owen W. Aronov v. Sam L. DIAMOND).
1901889.
Supreme Court of Alabama.
February 28, 1992.
Randy Myers and Richard Jordan, Montgomery, for petitioner.
John M. Bolton III of Robison & Belser, P.A., Montgomery, for respondents.
PER CURIAM.
Sam L. Diamond petitions this Court for a writ of mandamus directing Montgomery Circuit Judge Joseph D. Phelps to transfer *424 a pending case from Montgomery County, Alabama, to Jefferson County, Alabama.
In October 1983, Jake F. Aronov and Owen W. Aronov ("the Aronovs") entered into a general partnership agreement with Diamond. The partnership was known as A & D Partners. On February 10, 1984, the partnership acquired a leasehold interest in a parcel of land located in Montgomery County, Alabama. In order to finance improvements on the property, the partnership borrowed money from Central Bank of the South ("Central Bank"), executing a note, a leasehold mortgage, and a security agreement to Central Bank in February 1984. In June 1987, the partnership refinanced the loan, executing a promissory note payable to Central Bank in the amount of $563,285.04. The note was secured by the leasehold mortgage and a security interest in the Montgomery property and the equipment and fixtures on the property. In July 1987, the Aronovs and Diamond executed to Central Bank a continuing guaranty jointly and severally guaranteeing all indebtedness of A & D up to the sum of $563,285.04.
The parties have made principal and interest payments on the note and have reduced the principal amount due to $364,000.00. The Aronovs allege that Diamond has failed or refused to pay any amount of the remaining principal and accrued interest due on the note. In August 1990, the Aronovs acquired the promissory note from Central Bank for value and are now the assignees and owners of the note. The Aronovs filed a complaint against Diamond, claiming that Diamond owed his proportionate share of the remaining principal and interest due on the note. Count I of the Aronovs' complaint claims that Diamond "owes [them] his proportionate share of [the] note and accrued interest." Count II of the complaint alleges that Diamond owes "by way of contribution his proportionate share of [the] partnership debt evidenced by [the] note, and accrued interest."
The only question before this Court is whether the trial court erred in refusing to transfer this case from Montgomery County to Jefferson County, based on Diamond's argument that Montgomery County is not a proper venue for the action because he is a resident of Jefferson County.
A writ of mandamus will be issued only if the petitioner has a clear legal right to the order sought. Ex parte Izundu, 568 So.2d 771 (Ala.1990). In order for this Court to grant the writ of mandamus, there must be a clear showing that the trial judge erred in refusing to transfer the case to Jefferson County. Ex parte Rosebusch, Inc., 558 So.2d 356 (Ala.1990); Ex parte Ralston, 519 So.2d 488 (Ala.1987).
Diamond argues that real estate is not the subject matter of the action, in that the leasehold interest is not in controversy and there has been no attempted foreclosure of the mortgage. Diamond maintains that, because he is a resident of Jefferson County and because the action is a contract action, venue is proper only in the county of his residence and not in the county where the real estate is located.
The Aronovs argue that real estate is the "subject matter" of the controversy, that venue was proper in Montgomery County, where the land is located, and that, therefore, this writ is due to be denied.
Because the Aronovs are suing Diamond individually, the applicable statute is § 6-3-2, Ala.Code 1975, which reads, in pertinent part:
"(a) In proceedings of a legal nature against individuals:
"(1) All actions for the recovery of land, of the possession thereof or for a trespass thereto must be commenced in the county where the land or a material part thereof lies.
"(2) All actions on contracts, except as may be otherwise provided, must be commenced in the county in which the defendant or one of the defendants resides if such defendant has within the state a permanent residence.
"(3) All other personal actions, if the defendant or one of the defendants has within the state a permanent residence, may be commenced in the county of such residence or in the county in which the act or omission complained *425 of may have been done or may have occurred.
"(b) In proceedings of an equitable nature against individuals:
"(1) All actions where real estate is the subject matter of the action, whether it is the exclusive subject matter of the action or not, must be commenced in the county where the same or a material portion thereof is situated.
"(2) ....
"(3) Except as may be otherwise provided, actions must be commenced in the county in which the defendant or a material defendant resides."
See also Rule 82, Ala.R.Civ.P.
We will first address the issue of whether the "subject matter" of the action is real estate. If it is, then venue is proper in Montgomery County. "Subject matter," within the meaning of § 6-3-2, refers to the nature of the cause of action and of the relief sought. Ex parte Pratt, 514 So.2d 947 (Ala.1987); Ex parte Clardy, 460 So.2d 1273 (Ala.1984). An allegation that "one of the parties owns real estate, or has substantial rights in real estate which are dependent upon the settlement of the controversy, is not enough to make real estate the `subject matter' of the suit." Alabama Youth Services Board v. Ellis, 350 So.2d 405, 408 (Ala.1977). See also Wesson v. Wesson, 514 So.2d 947 (Ala.1987) ("subject matter" was real estate where the nature of the complaint and relief sought involved the determination of the validity of a conveyance of land, which in turn determined title to the property); Clark v. Smith, 191 Ala. 166, 67 So. 1000 (1915) (complaint for partition must be filed in county where part of the land is located).
In the present case, the complaint did not involve land; the relief sought was monetary compensation arising from a note executed by the partnership in which each partner was a one-third owner. The fact that the note was secured by a mortgage of real property does not turn the cause of action into one of which the "subject matter" is real estate. The complaint did not involve the determination of the validity of the leasehold interest or the validity of the mortgage of the Montgomery property, nor did it involve any determination of the validity of a conveyance of property or a question involving who owned legal or equitable title to property. There was also no count in the complaint seeking to foreclose the mortgage against Diamond.
Therefore, the "subject matter" of the action is not real estate, and venue is not proper in Montgomery County under § 6-3-2(a)(1), § 6-3-2(b)(1), or Rule 82(b)(1)(B), which require that an action involving real estate be brought in the county where the land is located.
Count I of the Aronovs' complaint seeks money allegedly owed by Diamond to the Aronovs based on the promissory note entered into by A & D Partners. Included as an exhibit to the petition for the writ of mandamus is a copy of the A & D Partnership Agreement, which specifically provides that the three partners will share equally in the profits and liabilities of the partnership, that is, that each of them will be liable for one-third of any partnership debt. An interpretation of the note and of the partnership agreement will determine Diamond's liability. This is an action based on contract, and venue is proper only in the county in which Diamond resides, Jefferson County.
The Aronovs argue that Count II of the complaint is an equitable claim for contribution, as to which, they argue, venue under Rule 82(b)(1) would be in Montgomery County. The right of contribution arises, as against noncontributing co-obligors, when one or more of the co-obligors satisfies and procures a discharge of the common obligation. Gafford v. Tittle, 224 Ala. 605, 141 So. 653 (1932). Contribution is primarily of equitable origin, but is also available at law on the theory of an implied promise. Spragins v. McCaleb, 237 Ala. 658, 188 So. 251 (1939); see also Holder v. Brooks, 261 Ala. 127, 73 So.2d 355 (1954). There is no need to resort to an implied promise in the present case, however, because the partnership agreement expressly provides that the Aronovs and Diamond will each pay one-third of the partnership *426 debts and expenses. Furthermore, Count II need not be construed as an equitable action for contribution, because Diamond has a contractual obligation to contribute one-third of the partnership debt.[1]
We note that, because venue is proper only in Jefferson County, no question arises as to whether Montgomery County is a more convenient forum. See Ala.Code 1975, § 6-3-21.1, which allows a court to transfer an action "to any court of general jurisdiction in which the action might have been properly filed."
Because the action is one on a contract, not an action of which the subject matter is real estate, proper venue is in the county of the defendant's residence, and the trial court erred in not transferring the action.
WRIT GRANTED.
HORNSBY, C.J., and ALMON, ADAMS, STEAGALL and INGRAM, JJ., concur.
NOTES
[1]  There is authority for the proposition that a partner cannot maintain an action at law against a copartner, regarding matters arising out of the partnership, until there has been an equitable accounting of the partnership affairs. See Broadmoor Realty, Inc. v. First Nationwide Bank, 568 So.2d 779, 783 (Ala.1990), quoting Broda v. Greenwald, 66 Ala. 538, 542 (1880). See also Hansford, Tilley's Alabama Equity (2d ed.) § 12-5 (1985); 59A Am.Jur.2d Partnership §§ 544, 550-98 (1987). However, Diamond has not raised any such defense and the parties have not argued this point, so we need not consider it in ruling on this petition.
