
651 P.2d 1264 (1982)
98 N.M. 620
Mrs. Manuel APODACA, et al., Plaintiffs-Intervenors-Appellants,
v.
The UNKNOWN HEIRS OF THE FOLLOWING PERSONS WHO ARE ADJUDGED TO BE OWNERS AND PROPRIETORS OF the TOME LAND GRANT, Louis Anaya, et al., Defendants-Appellees.
No. 13890.
Supreme Court of New Mexico.
September 7, 1982.
Rehearing Denied October 4, 1982.
*1265 Lorenzo Tapia, Albuquerque, Charles S. Solomon, Santa Fe, Arturo G. Ortega, Ray Vargas, Albuquerque, for plaintiffs-intervenors-appellants.
Ernesto Romero, Albuquerque, for defendants-appellees.

OPINION
SOSA, Senior Justice.
This is the second appeal from Valencia County Cause No. 14,849 and the fourth time the litigation involving the Tome Land Grant has been brought before this Court. Because an understanding of the significant events of the litigation preceding this appeal is important to an understanding of the issues, we first set forth a history of the case.
An earlier suit, Valencia County Cause No. 6,492, was filed in 1952 which purported to ascertain those persons who had any right, title or interest in the common lands of the Tome Land Grant. The Tome Land & Improvement Co., Inc., (Tome) was formed in 1955 from the community land grant. The trustees of the Tome Grant gave a deed to the corporation in which the owners set forth in the judgment were made stockholders. In 1968, the corporation sold 47,000 acres of commercial land, its only asset, to Horizon Corporation for $100.00 per acre. The appellees (dissenters) in this case are former stockholders of Tome who dissented to the sale in Valencia County Cause No. 15,042 pursuant to Section 51-28-3A, N.M.S.A. 1953 (Supp. 1975). This Court affirmed the trial court's valuation of the dissenters' shares at $12,415.50 *1266 per share. Tome Land & Improvement Co. v. Silva, 83 N.M. 549, 494 P.2d 962 (1972). The judgments were satisfied April 13, 1971. On remand, the dissenters were awarded $122,281.44 as attorney's fees. We affirmed on appeal. Tome Land and Improvement Co., Inc. (NSL) v. Silva, 86 N.M. 87, 519 P.2d 1024 (1973). The majority shareholders, who also received disbursements (approximately $6,000.00 per share), are not parties to this appeal. Certain dissenting shareholders elected to settle their claims before trial and received $7,500.00 each pursuant to a disbursement order entered December 27, 1968.
In 1967, the Legislature enacted a statute allowing conversion of community land grant corporations into general domestic corporations. § 8-2-19, N.M.S.A. 1953 (Repl.Vol. 1974). Cause No. 14,849 was filed in the District Court of Valencia County on August 8, 1968, to determine the rights of the parties to the common lands of the Tome Land Grant or to the proceeds of the sale of those lands. This case was consolidated with Cause No. 6,492.
Appellants (Apodaca) intervened to assert their entitlement to a share in the proceeds from the sale as purported heirs. They obtained a restraining order enjoining distribution of any further proceeds pending a determination of their claim. The trial court determined that Apodaca's claims were barred by laches and by Tome's adverse possession. On appeal, we reversed and held that the corporation was void because:
[C]ommunity land grant corporations were created by statute and therefore their powers are derived solely from statute.
Inasmuch as the appellee [Tome] had no authority to convert itself into a private corporation in 1955, the action is ultra vires and therefore invalid. It may not now be used to confirm that ownership of the land vested in Tome Company and the shareholders.
Apodaca v. Tome Land & Imp. Co. (NSL), 91 N.M. 591, 595, 577 P.2d 1237, 1241 (1978). We remanded and instructed the court "to make a determination of all rightful heirs to the Tome Land Grant. The court is further ordered to distribute to the rightful heirs the proceeds from the sale after deducting the defendants' reasonable costs and expenses used in maintaining the common land prior to sale." Id. at 598, 577 P.2d at 1244.
On remand, the dissenters entered claims as purported heirs. Apodaca filed a counterclaim on March 11, 1980, seeking return of any proceeds the "shareholders" had previously received in excess of what they will receive if they are ultimately determined to be heirs. The dissenters then filed a motion seeking dismissal of their claims as purported heirs and to be excused from remitting or offsetting any sums which they had previously received. After a hearing, the trial court granted their motion and entered an order on August 3, 1981, dismissing the claims of the dissenters and holding (1) that Apodaca's counterclaim was barred by the statute of limitations, (2) that the court had not reserved authority to rescind the prior disbursements to the dissenters, and (3) that there is no procedure in Section 51-28-4, 1953 Comp. (Supp. 1975), to set aside a judgment based on an erroneous valuation of stock.
The issues in this case are (1) whether Apodaca's counterclaim was barred by the applicable statute of limitations, § 37-1-4, N.M.S.A. 1978 (formerly § 23-1-4, N.M.S.A. 1953), and (2) whether the trial court has the authority to require appellees to remit any proceeds they have received in excess of their shares as heirs.
We hold that the counterclaim is not barred, and we reverse and remand to the district court for further proceedings.

STATUTE OF LIMITATIONS

I
Apodaca contends that, since appellee did not affirmatively plead the defense of the statute of limitations as required by *1267 N.M.R.Civ.P. 8(c), N.M.S.A. 1978, it cannot be a bar to the counterclaim. We hold that the statute of limitations was correctly raised by the appellees and considered by the trial court. However, because it had not run, it was not a bar to this counterclaim.
N.M.R.Civ.P. 8(c), N.M.S.A. 1978, requires that a party affirmatively plead the defense of the statute of limitations. Defenses shall be asserted in the responsive pleading if one is required. N.M.R.Civ.P. 12(b), N.M.S.A. 1978. Apodaca argues that the dissenters had the burden of raising a matter constituting an avoidance or affirmative defense, see McCasland v. Prather, 92 N.M. 192, 585 P.2d 336 (Ct.App. 1978), and that an affirmative defense which is not pled or otherwise properly raised is waived, Fredenburgh v. Allied Van Lines, Inc., 79 N.M. 593, 446 P.2d 868 (1968). It is true that the dissenters did not raise the issue of the statute of limitations in their motion to dismiss. However, a responsive pleading to a counterclaim would be a reply. A motion is not a responsive pleading. See N.M.R. Civ.P. 12(b), N.M.S.A. 1978. In the instant case, the dissenters were never required to file a reply since the trial court disposed of the issue in its hearing on the motion to dismiss.
We feel that the statute of limitations was properly raised in this case. At the trial court's hearing on the dissenters' motion to dismiss, the dissenters asserted that the running of the statute of limitations was one basis for their motion to dismiss Apodaca's counterclaim. Transcript of Testimony, pp. 53 through 56.
In Electric Supply Co. v. United States Fidelity & G. Co., 79 N.M. 722, 449 P.2d 324 (1969), where the parties were not required by the rules of civil procedure to file a pleading setting forth the affirmative defense of accord and satisfaction, we held that, in the absence of surprise or prejudice, the trial court properly considered the defense in connection with a motion for summary judgment. See also Hayes v. Philadelphia Transportation Company, 312 F.2d 522 (3d Cir.1963). In the case at bar, there was no claim in the record below nor in the brief-in-chief that Apodaca was surprised or prejudiced by the dissenters' assertion of the statute of limitations defense.
A trial court may allow pleadings to be amended to set up the statute of limitations defense, although generally it is true the defense is waived under N.M.R.Civ.P. 12(h) if not asserted in a responsive pleading. Chavez v. Kitsch, 70 N.M. 439, 374 P.2d 497 (1962). In Hayes, supra, the Court held that, where the parties contested a motion for summary judgment on the merits, the contention on appeal that a particular defense was improperly raised was without merit because the situation was no different than if the court had permitted an amended pleading pursuant to Fed.R.Civ.P. 15.
N.M.R.Civ.P. 15(b), N.M.S.A. 1978, provides that when an issue not raised by the pleadings is tried by the express or implied consent of the parties, it shall be treated in all respects as if it had been raised in the pleadings. In Terrill v. Western Am. Life Ins. Co., 85 N.M. 456, 513 P.2d 390 (1973), although the defendant did not affirmatively plead illegality as a defense in its answer as required by N.M.R.Civ.P. 8(c) nor at any time move to amend its answer, the issue was raised by the testimony at trial. It was litigated without objection and specifically ruled on by the trial court. We held that therefore the failure to affirmatively plead the defense did not become an issue on appeal. Id. A trial court does not commit error in considering a defense and making a decision on it if it appears that a defense is available under the issues litigated, and that substantial competent evidence supports its prerequisite facts. Posey v. Dove, 57 N.M. 200, 257 P.2d 541 (1953).
The defense of the statute of limitations may be raised by motion to dismiss *1268 where it is clearly apparent on the face of the pleading that the action is barred. Roybal v. White, 72 N.M. 285, 383 P.2d 250 (1963). In the case at bar, Apodaca was not prejudiced or surprised by the dissenters' assertion of the defense of the statute of limitations. The defense was raised and specifically argued before the trial court. We hold therefore that the trial court did not err in ruling on the motion to dismiss on that basis.

II
The Tome Land & Improvement Co., Inc., was a void corporation. Apodaca, supra. Therefore, it could not have had shareholders or dissenting shareholders. "The void corporation merely consisted of the same individuals who Apodaca had always recognized as her co-tenants." Id. at 596, 577 P.2d at 1242. Tome had no right to the proceeds from the sale and no authority to pay such proceeds to its "shareholders." Therefore, the court in Cause No. 15,042 was without jurisdiction to order a disbursement. The dissenters received and held the proceeds of the sale of the common lands contrary to the rights of the rightful owners, the heirs. A wrongful detention amounting to repudiation of the owner's rights or an exercise of dominion inconsistent with such rights is conversion. Molybdenum Corp. of America v. Brazos Engineering Co., 81 N.M. 708, 472 P.2d 971 (1970); Ross v. Lewis, 23 N.M. 524, 169 P. 468 (1917). Conversion was present in the case at bar since the "shareholders" claimed and erroneously received proceeds of the sale.
An action based on conversion of personal property must be brought within four years. § 37-1-4, N.M.S.A. 1978. In actions for injuries to, or conversion of, property, the cause of action shall not be deemed to have accrued until the injury or conversion complained of shall have been discovered by the party aggrieved. § 37-1-7, N.M.S.A. 1978.
Apodaca could not have discovered she had a cause of action for conversion until March 14, 1978, the date of our opinion in Apodaca, supra, which declared the Tome Land & Improvement Co., Inc., to be a void corporation. Until then, no one knew that the receipt of proceeds by the "shareholders" was contrary to the rights of the heirs and co-tenants. Apodaca brought her counterclaim on March 11, 1980, within the four-year time limit. The counterclaim was therefore not barred by the statute of limitations.

AUTHORITY OF THE TRIAL COURT
All proceeds of the sale of the common lands of the Tome Land Grant have been under the exclusive jurisdiction and control of the district court in this Cause No. 14,849. Therefore, all applications for disbursements have been made to the trial court in this cause. All disbursements of such proceeds were made by order of the district court in this same cause. Appellant objected to all disbursements of the proceeds except one disbursement of $7,500.00 to each of four dissenters who chose to settle before trial. The trial court is now involved with the determination of the rightful heirs and distribution to them of the proceeds pursuant to our mandate in Apodaca, supra.
The trial court erroneously believed that since Section 51-28-4, N.M.S.A. 1953 (Supp. 1975), contains no procedure to set aside a judgment based on a valuation of dissenters' stock, it had no authority to rescind excess disbursements.
It is well settled in New Mexico that the trial court has only such jurisdiction on remand with respect to an issue appealed as is conferred by the opinion and mandate of the appellate court. Van Orman v. Nelson, 80 N.M. 119, 452 P.2d 188 (1969); Gruschus v. C.R. Davis Contracting Company, 77 N.M. 614, 426 P.2d 589 (1967); Wilson v. Employment Security Commission, 76 N.M. 652, 417 P.2d 455 (1966); Sproles v. McDonald, 74 N.M. 243, 392 P.2d 584 (1964); Chronister v. State Farm Mutual Auto Ins. Co., 72 N.M. 159, 381 P.2d 673 (1963). "The *1269 only necessary action of the trial court is to comply with the mandate of the appellate court." Genuine Parts Co. v. Garcia, 92 N.M. 57, 60, 582 P.2d 1270, 1273 (1978).
This court did not address in Apodaca, supra, the continued viability of its decisions in Tome Land & Improvement Co. v. Silva, 83 N.M. 549, 494 P.2d 962 (1972), and Tome Land and Improvement Co., Inc. (NSL) v. Silva, 86 N.M. 87, 519 P.2d 1024 (1973). In 83 N.M. 549, we merely held that the district court's determination in Valencia County Cause No. 15,042 of the value of the dissenters' shares was reasonable and supported by substantial evidence. Since the district court in that cause had no authority over the proceeds, an application for a disbursement was then made in Cause No. 14,849. Both of those opinions are valid opinions since we approved not the disbursements but only the valuation of shares had the corporation been valid as we assumed at that time. Neither case affects our opinion in this case.
We have never considered the issue of proceeds of the sale of the Tome common lands which have already been disbursed. Therefore, the trial court never lost its authority over such disbursement of proceeds. Since the corporation was void, Apodaca, supra, there could be no shareholders and no dissenting shareholders, only heirs. The trial court's dismissal in this case of the dissenters' claims as heirs does not address the hundreds of other "shareholders" who also received payments from the proceeds of the sale. It is our opinion that only those persons ultimately determined to be heirs shall share in the proceeds of the sale. In addition, all heirs should receive a proportionate share of all proceeds. It is inconsistent with our opinion in Apodaca if any persons who are not heirs have received proceeds from the sale or if any heirs have received more than their proportionate share. Apodaca clearly stated that all heirs should share in the proceeds:
How can the shareholders be prejudiced by being forced to share the proceeds with their co-tenants? What harm is occasioned to them when they are informed that their ultra vires acts form a nullity and such acts will not preclude Apodaca from sharing what has always been hers? To do otherwise would have Justice with her arms folded as Equity walks out the door... . Requiring all co-tenants (heirs) to share in the proceeds ... will achieve a much more equitable result than would allowing the shareholders to keep all the proceeds... .
Id. at 598, 577 P.2d at 1244. [Emphasis added.]

CONCLUSION
For the reasons discussed above, we hold that (1) although the statute of limitations was properly considered by the trial court, it had not run and was not a bar to appellant's counterclaim, and (2) the trial court has not lost jurisdiction over the disbursement of proceeds from the sale of the common lands of the Tome Land Grant, including disbursements already made.
We, therefore, reverse the trial court and remand for further proceedings consistent with this opinion.
IT IS SO ORDERED.
EASLEY, C.J., and FEDERICI, J., concur.
