
585 N.W.2d 438 (1998)
255 Neb. 372
The OHIO NATIONAL LIFE INSURANCE COMPANY, Appellant,
v.
Norman G. RUST, Appellee.
No. S-97-464.
Supreme Court of Nebraska.
October 2, 1998.
*440 Steven W. Olsen and Jeffrey L. Hansen, of Simmons, Olsen, Ediger, Selzer, Ferguson & Carney, P.C., Scottsbluff, for appellant.
Laurice M. Margheim, of Curtiss, Moravek, Curtiss & Margheim, Alliance, for appellee.
WRIGHT, CONNOLLY, GERRARD, STEPHAN, and McCORMACK, JJ.
WRIGHT, Justice.

NATURE OF CASE
The Ohio National Life Insurance Company (Ohio National) sued its insured, Norman G. Rust, to recover payments made to Rust allegedly by mistake. Ohio National appeals the district court's order which granted summary judgment in favor of Rust.

SCOPE OF REVIEW
Summary judgment is proper when the pleadings, depositions, admissions, stipulations, and affidavits in the record disclose that there is no genuine issue as to any material fact or as to the ultimate inferences that may be drawn from those facts and that the moving party is entitled to judgment as a matter of law. Marrs v. Keelan, 254 Neb. 723, 578 N.W.2d 442 (1998).
In reviewing a summary judgment, an appellate court views the evidence in a light most favorable to the party against whom the judgment is granted and gives such party the benefit of all reasonable inferences deducible from the evidence. Id.

FACTS
Ohio National issued a whole life policy to Rust on November 10, 1964. The policy was designed to be paid up when Rust reached the age of 65 for a stated amount of $2,718. In November 1987, the policy became paid up, and in 1988, Ohio National notified Rust of a dividend in the amount of $9,791.15. In 1989, Ohio National notified Rust of a dividend in the amount of $9,978.66. On November 14, 1989, Rust requested that the dividends be paid to him in cash rather than accumulating on the policy. Accordingly, on November 27, Ohio National paid Rust $20,824.07, which included the two dividends plus interest. Thereafter, Ohio National sent Rust the following dividends: $10,188.97 in 1990; $10,353.68 in 1991; $10,533.03 in 1992; and $8,057.39 in 1993.
On approximately November 18, 1994, Ohio National notified Rust that the dividends paid to him since 1988 were paid by mistake and demanded that Rust reimburse the company in the sum of $59,286.09. Rust refused to do so, and on June 16, 1995, Ohio National commenced this action against him to recover the dividends.
Ohio National's petition alleged that it was entitled to restitution because the dividends paid to Rust were based upon the wrong policy amount being keyed into a computer. Instead of $2,718, the computer incorrectly showed a policy amount of $271,750, and the dividends paid to Rust were erroneously based upon this amount. Ohio National claimed that the dividends mistakenly paid to Rust, with interest but less the proper dividend payable of $671.05, amounted to *441 $59,286.09 and requested that judgment be made accordingly.
Rust's answer alleged that Ohio National's action was barred by the applicable statute of limitations and that Ohio National was guilty of laches in failing to timely discover the alleged mistake. Rust claimed that before accepting any dividend payment, he had inquired of agents and employees of Ohio National concerning his right to receive and retain the dividends and that he had been assured that he was entitled to retain them. Rust stated that in reliance upon such assurances, he spent the money.
Rust then filed a motion for separate trial on the issue of the statute of limitations raised in his answer, based upon Neb. Rev. Stat. § 25-221 (Reissue 1995). Subsequently, both parties filed motions for summary judgment. Rust's motion stated that the mistake which formed the basis of Ohio National's cause of action occurred in November 1987; that Ohio National paid Rust $20,824.07 on November 14, 1989 (check actually issued November 27); that the petition alleged no facts which would toll or extend the statute of limitations; and that Ohio National's petition was time barred as a matter of law. In addition, Rust claimed that Ohio National was guilty of laches sufficient to bar its recovery as a matter of law. Ohio National's motion claimed that there were no genuine issues of material fact and that it was entitled to judgment as a matter of law.
The affidavit which Rust submitted in support of his motion for summary judgment alleged that upon receiving notice of a dividend balance in excess of $20,000, he spoke with an employee of the Langford Agency, who placed a call to an Ohio National representative named "Angie." Rust stated that he told Angie he wanted to know that there was no mistake and that the dividends belonged to him. Angie allegedly called back and told Rust: "`[W]e checked and these are your dividends. You can spend them.'"
Rust further alleged that upon receipt of the dividend check in 1990, he again called Ohio National and was told that the check was his. Rust stated that he had no way of determining how much the annual dividends should or would be, that he relied on the representations of Ohio National, and that he believed he had a right to the dividends paid.
In support of its motion for summary judgment, Ohio National submitted two affidavits by Trudy Backus, vice president of individual insurance services. Backus alleged that Rust's policy amount mistakenly appeared on a computer as $271,750 rather than $2,718. The error allegedly occurred on November 11, 1987, when the amount of paid-up insurance was entered into the computer system. Backus explained that Ohio National calculates dividends for paid-up policies on the basis of the amount of insurance available in the policy and that any information requested by Rust or his local agent would have been based on the same computer error.
On each policy's anniversary, the computer system generates a status sheet to advise policyholder services associates to prepare a dividend check payable to the policyholder. Backus' affidavit alleged that the computer error in question was discovered sometime after November 10, 1994, when a status sheet was generated for Rust's policy and delivered to the policyholder services department. An experienced associate in the department received the status sheet, noticed that the sheet appeared peculiar, and requested that the policy file be sent to him. The mistake was alleged to have been discovered upon receipt of the policy file. Rust objected to Backus' affidavits on foundational grounds, and the record does not show that the district court received them. Also received into evidence were Ohio National's answers to written interrogatories, in which Ohio National denied any telephone conversations between the Langford Agency and the home office regarding the dividend payments other than a request by Rust that the dividends be paid in cash.
The district court granted summary judgment in favor of Rust and dismissed Ohio National's petition. The court concluded that Ohio National had the means and a reason to discover the mistake more than 4 years before the petition was filed and that Ohio National's cause of action arose no later than November 27, 1989. Because Ohio National failed to plead any excuse or reason for *442 delay in filing the petition, the court concluded that Ohio National's action was barred.

ASSIGNMENTS OF ERROR
Ohio National assigns as error that the district court erred (1) in sustaining Rust's motion for summary judgment, (2) in overruling Ohio National's motion for summary judgment, (3) in finding that the statute of limitations barred Ohio National's claim, (4) in finding that the "discovery rule" did not apply so as to toll the applicable statute of limitations, (5) in dismissing Ohio National's petition, and (6) in failing to find that Ohio National's affidavit testimony was admissible and relevant.

ANALYSIS
We first address Ohio National's second assignment of error, which is that the district court erred in overruling its motion for summary judgment. Summary judgment is proper when the pleadings, depositions, admissions, stipulations, and affidavits in the record disclose that there is no genuine issue as to any material fact or as to the ultimate inferences that may be drawn from those facts and that the moving party is entitled to judgment as a matter of law. Marrs v. Keelan, 254 Neb. 723, 578 N.W.2d 442 (1998).
Independent of the statute of limitations, courts of equity have the inherent power to refuse relief after undue and inexcusable delay in bringing suit. See, In re Estate of Widger, 235 Neb. 179, 454 N.W.2d 493 (1990); Campbell v. Kirby, 195 Neb. 610, 239 N.W.2d 792 (1976). According to Rust, he contacted a representative of Ohio National sometime around November 1989, when Rust received notice of a dividend balance in the amount of $20,824.07, and expressed concern as to whether the dividend was a mistake. Rust stated that upon receipt of another dividend check in 1990, he again contacted Ohio National as to whether the money was his. Questions of fact remain regarding whether there was inexcusable neglect in Ohio National's failure to discover the mistaken payments sooner and whether Rust was prejudiced as a result of such neglect. Such questions could result in a finding by the district court that laches bars Ohio National's suit regardless of whether any claims therein were brought within the statute of limitations. Therefore, the court did not err in overruling Ohio National's motion for summary judgment.
We next address the statute of limitations issue and Rust's motion for summary judgment. A petition which makes apparent on its face that the cause of action it asserts is ostensibly barred by the statute of limitations fails to state a cause of action and is demurrable unless the petition alleges some excuse which tolls the operation and bar of the statute. Vanice v. Oehm, 247 Neb. 298, 526 N.W.2d 648 (1995). See, also, Upah v. Ancona Bros. Co., 246 Neb. 585, 521 N.W.2d 895 (1994). Rust's motion, although couched in terms of a summary judgment, was really a demurrer alleging that Ohio National's petition was barred by the statute of limitations and, therefore, failed to state a cause of action. Rust alleged that the mistake which formed the basis of Ohio National's cause of action occurred on November 11, 1987, and that Ohio National paid Rust $20,824.07 on November 14, 1989 (check actually issued November 27). Rust asserted that the petition alleged no facts which would toll or extend the statute of limitations and that the action was therefore barred because it was not brought within 4 years after the cause accrued. This is essentially an allegation that the petition is barred on its face by the applicable statute of limitations.
A motion for summary judgment is not a proper method to challenge the sufficiency of a petition to state a cause of action. Ruwe v. Farmers Mut. United Ins. Co., 238 Neb. 67, 469 N.W.2d 129 (1991). Rather, when it is asserted in a motion for summary judgment that an opposing party has failed to state a cause of action, as far as that issue is concerned, the motion may be treated as one for judgment on the pleadings, notwithstanding its designation as something other than that. Id.
In order to protect a plaintiff's right to amend, we have stated that when a party challenges the sufficiency of a petition to state a cause of action, a motion for judgment on the pleadings should be sustained *443 only when an amendment cannot cure the defect. Hoch v. Prokop, 244 Neb. 443, 507 N.W.2d 626 (1993). Where a motion successfully challenges the sufficiency of a petition to state a cause of action and an amendment could cure the defect, we have treated the motion as a demurrer and entitled the plaintiff to amend the petition. See id.
Therefore, we must consider whether Ohio National's petition stated a cause of action. There is some confusion regarding the relief requested by Ohio National. The petition sets forth that payments were mistakenly made to Rust in the amount of $20,824.07 on November 14, 1989; $10,188.97 in 1990; $10,353.68 in 1991; $10,533.03 in 1992; and $8,057.39 in 1993. However, Ohio National asserts only one cause of action, requesting judgment on these payments in the amount of $59,286.09.
The district court concluded that Ohio National's cause of action came into being "no later than" November 27, 1989, and that its petition was filed in June 1995. The court therefore determined that since Ohio National failed to plead any excuse or reason for delay in filing the petition and it had the means and reason to discover the mistake more than 4 years before the petition was filed, Ohio National's cause of action was barred by the applicable statute of limitationsNeb. Rev. Stat. § 25-207 (Reissue 1995). The court found that all other pending motions were moot; entered summary judgment against Ohio National, in favor of Rust; and dismissed Ohio National's petition as time barred.
Rust argues that the district court correctly sustained his motion for summary judgment because Ohio National had claimed only one mistake, the erroneous computer entry, and that, therefore, all alleged injuries accrued from that event. Thus, Rust argues that absent an excuse why Ohio National did not discover the mistake, the cause of action accrued from the date of the mistaken computer entry or the date of the first payment, at the latest.
In support of this position, Rust relies upon S.I.D. No. 145 v. Nye, 216 Neb. 354, 343 N.W.2d 753 (1984). In Nye, we held that a legal malpractice action based upon an attorney's failure to file the necessary annexation certificate accrued on the date of the omission of filing of the certificate. The plaintiff filed suit 17 years after the fact and claimed that the statute of limitations was tolled because the attorney had continued as plaintiff's counsel and had an ongoing duty to file a certificate. In rejecting this argument, we explained that the failure to file a certificate 17 years previously was a solitary breach of duty upon which a claim of malpractice could be based. We stated that any recurring losses in tax revenue as a result of the failure to file such certificate bore only upon the possible damages caused by the omission and that the cause of action accrued when the attorney failed to file a certificate.
Nye is inapplicable to the case at bar. Here, although there are six dividend payments, there are, in effect, five separate causes of action. The basis of Ohio National's cause of action against Rust is the payments which were allegedly made in error. Generally, a cause of action accrues and the statute of limitations begins to run when the aggrieved party has the right to institute and maintain suit. St. Paul Fire & Marine Ins. Co. v. Touche Ross & Co., 244 Neb. 408, 507 N.W.2d 275 (1993). A party does not have a right to institute and maintain suit to recover a mistaken payment until such payment is made, and therefore, the statute of limitations for an action to recover a mistaken payment does not begin to run until such payment is made. See, Partipilo v. Hallman, 156 Ill.App.3d 806, 109 Ill.Dec. 387, 510 N.E.2d 8 (1987) (suit by owner against neighbor for unjust enrichment based on owner's mistaken payments of real estate taxes assessed to neighbor accrued, for limitations purposes, upon payment of taxes each year); Brookfield v. Rock Island Improvement Co., 205 Ark. 573, 169 S.W.2d 662 (1943) (in action for mistake in payment of taxes, statute of limitations ran from time plaintiff made each payment).
The district court erroneously concluded that Ohio National's cause of action for the payments accrued, at the latest, on the date the first payment was made. When Ohio *444 National made the first allegedly erroneous dividend payment, it had a cause of action for that payment, and the statute of limitations for its action to recover the first payment began to run at that time. Additional causes of action to recover subsequent mistaken dividend payments accrued on the dates those payments were made. What caused the mistake or prevented discovery may be relevant to whether there has been a tolling of the statute of limitations as to each payment, but each payment must be treated separately. Accordingly, the first cause of action accrued November 27, 1989, with the payment of $20,824.07, and subsequent causes of action accrued in 1990, 1991, 1992, and 1993.
Ohio National filed its petition against Rust on June 16, 1995. The payments of $20,824.07 in 1989 and $10,188.97 in 1990 are, on their face, barred by the 4-year statute of limitations. The petition does not allege any excuse which would toll the statute of limitations. Specifically, the petition, although mentioning that the mistake resulted from a computer error, does not indicate why the mistaken payments could not have been discovered earlier. See, Broekemeier Ford v. Clatanoff, 240 Neb. 265, 481 N.W.2d 416 (1992); Newton v. Brown, 222 Neb. 605, 386 N.W.2d 424 (1986); Lee v. Brodbeck, 196 Neb. 393, 243 N.W.2d 331 (1976); Reed v. Barnes, 113 Neb. 414, 203 N.W. 567 (1925). Because actions to recover the 1989 and 1990 payments are ostensibly barred by the statute of limitations and the petition fails to allege any excuse which would toll the operation and bar of the statute, the petition fails to state causes of action as to those payments and a demurrer should have been sustained. However, because it is unclear whether Ohio National could avoid the statutory bar by pleading an excuse that would toll the statute, the district court should have granted Ohio National leave to amend.
As to the payment made in 1991, it is not possible to tell from the face of the petition whether the cause of action is barred by the applicable statute of limitations because the petition does not set forth the date on which the payment was made. If the payment was made more than 4 years prior to the date the petition was filed, then the 1991 payment also fails to state a cause of action and Ohio National should be given leave to amend and set forth any reasons why its cause of action is not barred by the applicable statute of limitations.
Regarding the payments made in 1992 and 1993, it is clear that these payments were made within 4 years of the date that the petition was filed. Therefore, the petition states causes of action as to those payments.

CONCLUSION
The district court did not err in overruling Ohio National's motion for summary judgment, because material issues of fact remain with regard to the issue of laches. However, the court erred in sustaining Rust's motion for summary judgment. Ohio National has failed to state a cause of action for recovery of the payments ostensibly made more than 4 years from the date suit was commenced. Rust's motion for summary judgment should be treated as a demurrer for failure to state a cause of action, and Ohio National should be given leave to amend its petition to set forth reasons, if any exist, why the statute of limitations was tolled as to those payments. Insofar as it alleges payments within 4 years of the filing of the petition, Ohio National's petition sets forth causes of action not barred by the applicable statute of limitations.
The judgment of the district court is reversed, and the cause is remanded for further proceedings.
REVERSED AND REMANDED FOR FURTHER PROCEEDINGS.
WHITE, C.J., not participating.
