
530 N.W.2d 247 (1995)
247 Neb. 769
Keith D. HANGMAN, Appellant,
v.
Richard J. BRUENING and Rita J. Bruening, Husband and Wife, et al., Appellees.
No. S-93-697.
Supreme Court of Nebraska.
April 7, 1995.
*248 Thomas A. Fitch, of Fitch Law Office, South Sioux City, for appellant.
Wayne E. Boyd, of Boyd Law Office, P.C., South Sioux City, for appellees Bruening.
WHITE, C.J., CAPORALE, FAHRNBRUCH, LANPHIER, WRIGHT, and CONNOLLY, JJ.
FAHRNBRUCH, Justice.
Keith D. Hangman's 1992 petition to quiet the title to land over which Richard J. Bruening and Rita J. Bruening have an easement must be dismissed under the doctrine of res judicata, an issue which we raise sua sponte.
We vacate the March 8, 1993, judgment of the district court for Dixon County in favor of the Bruenings and remand the cause to that court with direction to dismiss Hangman's June 2, 1992, petition filed against the Bruenings and against any interest the Bruenings have in the easement over Hangman's land.

FACTS
On April 16, 1991, Hangman brought an action against the Bruenings to quiet title in him to a strip of land 2 rods wide across the north side of the southeast quarter of the southeast quarter of Section 33, Township 31 North, Range 5 East of the 6th P.M., in Dixon County, Nebraska. In that action, Hangman claimed that the Bruenings had abandoned their easement over the strip of land previously described and that the easement was no longer valid.
On November 27, 1991, after a trial on the merits of the April 16 petition, the district court entered a judgment finding that the Bruenings' easement was valid and that it had not been abandoned by the Bruenings through lack of use. On January 27, 1992, Hangman's motion for a new trial was overruled. We take judicial notice that the records of this court reflect that no appeal was taken by Hangman from the 1991 judgment.
On June 2, 1992, Hangman filed a second quiet title action against the Bruenings "and all other persons having or claiming an interest in" the land here in question. The second law suit, which is the subject of the present appeal, involves the same strip of land and easement that were the subject of the 1991 quiet title action. Hangman's second quiet title action is not based upon the Bruenings' alleged abandonment of their easement, but, rather, upon Hangman's claim that he adversely possessed the strip of land, including Bruenings' easement, for more than 10 years.
*249 On August 4, 1992, Hangman filed a motion for summary judgment against the Bruenings and a motion for default judgment against all other defendants who did not answer Hangman's petition. The motions were overruled. Subsequently, a summary judgment motion filed by the Bruenings was also overruled, and the case was tried in January 1993.
The district court entered an order, filed March 8, 1993, finding, as it had in the first case, that the Bruenings' easement was still in force and had not been abandoned by them. After his motion for new trial was overruled, Hangman appealed to the Nebraska Court of Appeals. Pursuant to our authority to regulate the caseloads of the appellate courts, this case was removed from the Court of Appeals' docket to this court's docket.

ANALYSIS
This court need not reach the issues ruled upon by the district court in Hangman's 1992 action. At all times relevant herein, Hangman's 1992 action was barred under the doctrine of res judicata. Res judicata was not raised as an affirmative defense in the Bruenings' amended answer. However, an appellate court may raise the issue of res judicata sua sponte. See, Eggland v. Eggland, 240 Neb. 393, 482 N.W.2d 245 (1992); Dakota Title v. World-Wide Steel Sys., 238 Neb. 519, 471 N.W.2d 430 (1991). We have elected to do so.
Both Hangman's 1991 action and his 1992 action were brought against the Bruenings to quiet title to the same strip of land to which Hangman claimed ownership. The easement Hangman asked the district court to void in 1992 is the same easement Hangman asked the court to void in 1991. The same issue, the Bruenings' interest in the easement, was litigated in both actions and, insofar as is relevant here, by the same parties, i.e., Hangman and the Bruenings.
The doctrine of res judicata bars relitigation not only of those matters actually litigated, but also of those matters which might have been litigated in an earlier proceeding, Dakota Title, supra, if (1) the former judgment was rendered by a court of competent jurisdiction, (2) the former judgment was a final judgment, (3) the former judgment was on the merits, and (4) the same parties or their privies were involved in both actions, Wicker v. Vogel, 246 Neb. 601, 521 N.W.2d 907 (1994), and Smith v. Smith, 246 Neb. 193, 517 N.W.2d 394 (1994).
The doctrine of res judicata is based on the principle that a final judgment on the merits by a court of competent jurisdiction is conclusive upon the parties in any later litigation involving the same cause of action. In re Estate of Wagner, 246 Neb. 625, 522 N.W.2d 159 (1994); Schieffer v. Catholic Archdiocese of Omaha, 244 Neb. 715, 508 N.W.2d 907 (1993). The doctrine of res judicata rests on the necessity to terminate litigation and on the belief that a person should not be vexed twice for the same cause. DeVaux v. DeVaux, 245 Neb. 611, 514 N.W.2d 640 (1994).
Here, the 1991 judgment was rendered by a court of competent jurisdiction in Dixon County, the county in which the property at issue and easement thereon is located. The 1991 quiet title action was based upon the theory that the easement had been abandoned by the Bruenings. After the 1991 trial on the merits, the district court entered an order finding that the easement in question was valid and that it had not been abandoned by the Bruenings through lack of use. Thus, the 1991 judgment was based upon the merits of the case brought by Hangman against the Bruenings and became final when there was no appeal of the judgment.
The present quiet title action, although based upon the theory of adverse possession, involved the same rights between the same parties as did the 1991 quiet title action. The theory of adverse possession could have been raised in the earlier quiet title litigation. All matters which could have been litigated in the earlier proceedings are barred by the doctrine of res judicata.
We, therefore, vacate the March 8, 1993, judgment entered by the district court for Dixon County and remand the cause to that court with direction to dismiss Hangman's June 2, 1992, petition filed against the Bruenings *250 and against any interest the Bruenings may have in the easement over Hangman's land.
JUDGMENT VACATED, AND CAUSE REMANDED WITH DIRECTION TO DISMISS.
