
719 P.2d 819 (1986)
104 N.M. 241
James D. ROMERO and L. Norene Romero, Plaintiffs-Appellees,
v.
U.S. LIFE INSURANCE COMPANY OF DALLAS, Defendant-Appellant.
No. 8550.
Court of Appeals of New Mexico.
May 1, 1986.
Paul A. Phillips, Dan A. McKinnon, III, Marron, McKinnon & Ewing, Albuquerque, for plaintiffs-appellees.
Leonard G. Espinosa, Moses, Dunn, Beckley, Espinosa & Tuthill, Albuquerque, for defendant-appellant.

OPINION
MINZNER, Judge.
A motion for clarification having been filed by plaintiffs, the prior opinion is withdrawn and the following is substituted.
Defendant brings an interlocutory appeal from the trial court's denial of its motion to dismiss for failure to state a claim. This court accepted two issues for review. They are: (1) whether the trial court erred in considering matters outside the record in ruling on the motion to dismiss; and (2) *820 whether the trial court erred in failing to dismiss the complaint on the basis the claim was time-barred. We reverse.

Facts and Proceedings Below
On March 7, 1984, plaintiffs sued defendant, claiming damages by reason of the recording of a "Notice of Subrogation" on October 5, 1978. Defendant's notice indicated it was entitled to be subrogated to the rights of the Internal Revenue Service because defendant had paid a federal tax lien asserted against plaintiffs' property. Plaintiffs' complaint also alleged damages by reason of defendant's suit to foreclose the tax lien and the notice of lis pendens filed November 6, 1978. The prior litigation, in which this court denied defendant's right to subrogation, is reported at 98 N.M. 699, 652 P.2d 249 (Ct.App.1982).
Defendant's amended answer alleged, among other things, that plaintiffs' claim was barred by the statute of limitations; defendant subsequently moved to dismiss the complaint. After a hearing, both parties filed memorandum of law. Plaintiffs argued that their cause of action had not accrued until the foreclosure suit terminated. Defendant argued that, because the counterclaims had been dismissed, plaintiffs' cause of action had not been tolled. See King v. Lujan, 98 N.M. 179, 646 P.2d 1243 (1982). Plaintiffs also argued that defendant was estopped from relying on the statute because of its representation in the prior suit that the claim had been asserted prematurely.
The trial court denied the motion on the ground that plaintiffs' counterclaims to defendant's foreclosure suit had tolled the statute of limitations. Alternatively, the trial court found that defendant was estopped from asserting the statute. The trial court, however, certified issues for an interlocutory appeal. See NMSA 1978, § 39-3-4. The trial court also granted plaintiffs' motion to amend their complaint.

Discussion
On appeal, defendant first contends that the trial court erred in failing to dismiss the complaint because the face of the complaint showed the claim was barred. Plaintiffs argue that their complaint and defendant's answer contained sufficient facts from which the trial court could have made its determination or, alternatively, that the trial court was entitled to take judicial notice of its own records. See NMSA 1978, Evid.R. 201 (Repl.Pamp.1983). Defendant contends the trial court erred in considering the record of the foreclosure suit because neither party had requested that the motion be treated as one for summary judgment, see Civ.P.Rule 12(b) (Repl.Pamp. 1980), and because defendant had objected to such treatment. See Emery v. University of New Mexico Medical Center, 96 N.M. 144, 628 P.2d 1140 (Ct.App.1981).
On consideration of the arguments and the record on appeal, we conclude that we need not answer the first question certified. Plaintiffs' contention that the trial court properly considered matters other than the pleadings in effect asks us to affirm the trial court as right for the wrong reason. See State v. Beachum, 83 N.M. 526, 494 P.2d 188 (Ct.App.1972). For the reasons that follow, defendant's motion to dismiss for failure to state a claim should have been granted.
In ruling on a motion to dismiss, all facts well-pleaded are accepted as true. Candelaria v. Robinson, 93 N.M. 786, 606 P.2d 196 (Ct.App.1980). Only the allegations of the complaint, however, are to be considered. McNutt v. New Mexico State Tribune Co., 88 N.M. 162, 538 P.2d 804 (Ct.App.1975). Legal conclusions or inferences that may be drawn from the allegations are not admitted. Id.
Plaintiffs argue that the complaint contained sufficient facts from which the trial court could infer that the statute had been tolled while the prior proceedings were pending. We disagree.
Plaintiffs' complaint alleges a wrongful act in 1978, from which they first suffered damages later the same year. There are no allegations concerning the counterclaims. We need not decide whether the statute of limitations for slander of title suits in New Mexico is the three-year limitation *821 for personal injury, NMSA 1978, Section 37-1-8, or the four-year limitation for damages to property or for no unspecified actions, NMSA 1978, Section 37-1-4. We also need not decide whether the cause of action accrued when plaintiffs suffered damages, see Shenefield v. Axtell, 274 Or. 279, 545 P.2d 876 (1976), or when defendant's notice was recorded. There being no allegations in the complaint as to tolling and estoppel, we agree that defendant's motion to dismiss should have been granted. Stringer v. Dudoich, 92 N.M. 98, 583 P.2d 462 (1978); Rather v. Allen County War Memorial Hospital, 429 S.W.2d 860 (Ky.1968). Plaintiffs' complaint stated facts that showed a cause of action which by 1984 was barred by the passage of time. Cf. Hernandez v. Anaya, 66 N.M. 1, 340 P.2d 838 (1959).
Alternatively, plaintiffs have argued that the trial court could properly take judicial notice of its records in an earlier case involving these parties. We recognize the court's inherent power to judicially notice its own records without specifically approving the court's procedure in this case. See Frost v. Markham, 86 N.M. 261, 522 P.2d 808 (1974).
Nevertheless, when matters outside the pleadings are presented to and not excluded by the court, the motion shall be treated as one for summary judgment. Transamerica Insurance Co. v. Sydow, 97 N.M. 51, 636 P.2d 322 (Ct.App.1981); NMSA 1978, Civ.P.R. 12(b) (Repl.Pamp. 1980). Whatever may have been the propriety of the trial court's consideration of matters outside the pleadings, we do not have before us the proceedings of the foreclosure suit, part of which apparently formed the basis of the trial court's disposition of defendant's motion. Absent the record of those facts, no question is presented to this court for review. See Richardson Ford Sales v. Cummins, 74 N.M. 271, 393 P.2d 11 (1964).
The trial court erred in its denial of defendant's motion to dismiss plaintiffs' claim. We reverse the trial court and remand with instructions for the trial court to grant defendant's motion. Dismissal shall be without prejudice. No costs are awarded.
IT IS SO ORDERED.
DONNELLY and GARCIA, JJ., concur.
