
727 P.2d 504 (1986)
Ralph BAERTSCH; Terry A. Browne and Susan G. Browne, husband and wife; Ingram-Clevenger, Inc., a Montana corporation; Norma J. Andriolo; Clinton H. Jenks and Clinton H. Jenks and Victoria J. Jenks, husband and wife; George Randall Fraser and Mary E. Fraser, husband and wife; Gerald Vern Evans and Yvone J. Evans, husband and wife; George A. Algard and Susan E. Algard, husband and wife; Harold R. Cranmer and Janet Cranmer, husband and wife; Charles J. Kassner; Carl Samuel Peil and Pamela A. Peil, husband and wife; Forrest A. Baertsch; McHugh Land & Livestock Co., a Montana corporation; Peter J. McHugh, Jr. and Mary J. McHugh, husband and wife; David B. Hahn and Carol W. Hahn, husband and wife, Appellants,
v.
COUNTY OF LEWIS AND CLARK, a political subdivision of the State of Montana, and all other persons unknown, claiming or who might claim any right, title, estate or interest in, or lien or encumbrance upon, the real property described in the Complaint, or any thereof, adverse to appellants' ownership, or any cloud upon appellants' title thereto, whether such claim or possible claim be present or contingent, including any claim or possible claim of dower, inchoate or accrued, Respondents.
No. 85-360.
Supreme Court of Montana.
Submitted on Briefs August 7, 1986.
Decided September 12, 1986.
Rehearing Denied November 25, 1986.
*505 Smith Law Firm, P.C., Robert J. Sewell, Jr., Helena, for appellants.
Mike McGrath, Co. Atty., Peter Funk, Deputy Co. Atty., Helena, for respondents.
WEBER, Justice.
This is an appeal from the judgment of the District Court of the First Judicial District, in which the court dismissed the landowners' complaint and declared Lewis and Clark County the owner of the 100 foot right-of-way which constitutes McHugh Drive near Helena, Montana. We reverse and remand.
The controlling issue is whether the District Court erred in dismissing the action as barred. The other issues remain to be decided by the District Court on remand.
The facts in the present case are basically set forth in the recent case of Ingram-Clevenger, Inc. v. Lewis and Clark County (Mont.1981), 636 P.2d 1372, 38 St.Rep. 1696. In Ingram-Clevenger, all of the landowners whose property is adjacent to McHugh Drive petitioned the Commissioners of Lewis and Clark County to abandon 40 feet of the right-of-way, that being 20 feet on either side of the Drive. The landowners contended that the statutory provision for abandonment of county roads was mandatory where all property owners petitioned. The County Commissioners refused to abandon any part of the Drive. The landowners were granted a writ of mandamus by the District Court which directed the County Commissioners to partially abandon McHugh Drive. We concluded that the authority to abandon on the part of the County Commissioners was discretionary and that mandamus did not lie. As a result, in Ingram-Clevenger, no part of McHugh Drive was abandoned. The judicial portion of the proceedings in Ingram-Clevenger were brought for judicial review of the administrative actions of the Lewis and Clark County Commissioners under the Montana Administrative Procedure Act, and for a peremptory writ of mandamus directed to the Commissioners. In the court proceedings, a petition was filed by the landowners, the administrative record was submitted by stipulation, and briefs and oral argument were presented by the parties. No answer or response was filed by the County and no evidence was submitted by the landowners on the question of ownership of the Drive. The only issues in Ingram-Clevenger were the propriety of the decision by the County Commissioners not to abandon a portion of McHugh Drive, and the appropriateness of mandamus.
After Ingram-Clevenger came down, essentially the same landowners filed their complaint in the present action. Their basic contentions were that McHugh Drive in its entirety was never properly dedicated as a county road, the County abandoned all that portion of the road right-of-way not actually used for roadway and borrow pits, the landowners have obtained title to the disputed portion of the right-of-way by adverse possession, and the County's claim was barred by equitable estoppel. The County raised the defense of res judicata as well as other theories of defense. The District Court concluded that res judicata was applicable, and denied the prayer of the landowners, quieting title in the County to the 100 foot right-of-way. The landowners appeal.

I
Did the District Court err in dismissing the action as barred?
The District Court held that Ingram-Clevenger barred this action and that the affirmative defenses of res judicata, the doctrine of merger, the rule against splitting causes of action, and collateral estoppel were well taken. This Court has previously held that:

*506 Both the rule against splitting causes of action and the doctrine of merger are inextricably related to the principles of res judicata; and the application of either to bar a subsequent action depends upon the existence of a "valid and final" prior judgment. As was stated in Mervin v. F.T.C. (D.C.Cir.1978), 591 F.2d 821, 830:
"Principles of res judicata prevent relitigation not only on the grounds or theories actually advanced, but also on those which could have been advanced in the prior litigation." (Citations omitted.)
Hughes v. Salo (Mont.1983), 659 P.2d 270, 274, 40 St.Rep. 289, 295. Counsel and the trial judge did not specifically address the defenses of merger, rule against splitting causes of action, and collateral estoppel separate from the defense of res judicata. As indicated in the foregoing quotation, we conclude that the doctrine of merger and the rule against splitting causes of action are inextricably related to the principles of res judicata. So far as collateral estoppel is concerned, no facts have been presented suggesting a basis for estoppel separate from the other affirmative defenses.
We have applied a four element test in determining whether or not a second action is barred under these circumstances, and we consider the same at the present time with regard to all of such affirmative defenses: first, the parties or their privies must be the same; second, the subject matter of the action must be the same; third, the issues must be the same; fourth, the capacities of the persons must be the same in reference to the subject matter and to the issue between them. See State ex rel. Sullivan v. School District (1935), 100 Mont. 468, 50 P.2d 252; Smith v. County of Musselshell (1970), 155 Mont. 376, 472 P.2d 878; S-W Co. v. John Wight, Inc. (1978), 179 Mont. 392, 587 P.2d 348; Harris v. Harris (Mont.1980), 616 P.2d 1099, 37 St.Rep. 1696.
The key element here is whether the issues are the same. In Brannon v. Lewis and Clark County (1983), 143 Mont. 200, 387 P.2d 706, this Court approved the following language from Phoenix Mutual Life Insurance Co. v. Brainard (1928), 82 Mont. 39, 44, 265 P. 10, 12:
`Unless it clearly appears that the precise question involved in the second case was raised and determined in the former, the judgment is no bar to the record action.'
Brannon, 143 Mont. 200, 207, 387 P.2d 706, 710-11.
In Ingram-Clevenger, the fundamental issue was whether or not all landowners could compel the County to partially abandon McHugh Drive. This Court concluded that the controlling statutes were discretionary and affirmed the denial of abandonment by the County Commissioners. As a result, the District Court decision in Ingram-Clevenger granting mandamus to the landowners was vacated.
In the present case the essential claims of the landowners are that: (1) the instruments granting a 100 foot right-of-way to the County in 1890 were conveyances and were not properly recorded or indexed; (2) the County Commissioners failed to follow the statutory procedure in granting the petition for roadway in 1890; (3) the County abandoned all of that portion of the right-of-way not actually used for the roadway and borrow pits; (4) the landowners have obtained the disputed portion of the right-of-way by adverse possession; (5) the doctrine of equitable estoppel bars the County's claim to the 100 foot right-of-way; and (6) the doctrine of res judicata bars the claim of the County as to some of the landowners.
We conclude that the issues in the two cases are not the same. In Ingram-Clevenger the request of the landowners was for the vacation of a portion of McHugh Drive under the statutory authority granted to the County Commissioners. The title or ownership to the Drive was not in any manner involved in that proceeding. In contrast, the essential claims in the present case are issues relating to the title to the McHugh Drive roadway itself. Such issues could not have been properly presented as a part of the proceeding for vacation of McHugh Drive. The Board of *507 County Commissioners has no authority to adjudicate title. Under the Administrative Procedure Act, as stated in Ingram-Clevenger, the authority of the District Court is limited to a consideration of the proceedings before the County. We conclude that the issues of the present action are not the same issues as in Ingram-Clevenger. As a result the present action is not barred under a theory of res judicata, merger, the rule against splitting causes of action or the doctrine of equitable estoppel.
We reverse the District Court and remand for trial of the issues on the merits.
TURNAGE, C.J., and MORRISON, GULBRANDSON and SHEEHY, JJ.
HARRISON, Justice, dissenting.
I dissent.
In Ingram-Clevenger we were asked to decide whether county commissioners are statutorily mandated to abandon county roads when petitioned by landowners, pursuant to § 7-14-2601 et seq., MCA. We found the authority discretionary. The commissioners concluded abandonment of 40 feet of the right-of-way of McHugh Lane was not in the best interests of the county roads and the county road districts.
Regrettably the county did not move for summary judgment based on the doctrine of res judicata. It did, however, raise the doctrine as a defense, which I believe is well taken. Certainly access to the courts to pursue a lawful claim is central to our constitutional system. Of equal importance to the functioning of the system, however, is the notion that at some point litigation must come to an end. In this case, that point was reached when we decided Ingram-Clevenger.
The practice of relitigation is condemned by the United States Supreme Court. U.S. v. California and Oregon Land Co., (1904), 192 U.S. 355, 24 S.Ct. 266, 48 L.Ed. 476, and Grubb v. Public Utilities Commission of Ohio (1930), 281 U.S. 470, 50 S.Ct. 374, 74 L.Ed. 972. In the Oregon Land case, the United States brought an action claiming certain patents it had granted to the California and Oregon Land Co. were void because of a statute. The court ruled against the United States. On the second try it claimed the statutes were void because some of the property was on Indian Tribal land. Mr. Justice Holmes, writing for the majority, stated:
The whole tendency of our decisions is to require a plaintiff to try his whole cause of action and his whole case at one time. He cannot even split up his claim, [citing cases] and, a fortiori, he cannot divide the grounds of recovery.
Oregon Land, 192 U.S. at 358, 24 S.Ct. at 267, 48 L.Ed. at 479.
In the Grubb case the plaintiff unsuccessfully sought to restrain, through the state courts, enforcement of an order allowing a license to operate a bus on all but a tiny portion of a bus route. Plaintiff then brought suit in federal district court alleging the order violated the Commerce Clause of the United States Constitution. The suit was dismissed. The United States Supreme Court, in upholding the dismissal said:
[A] judgment on the merits in one suit is res judicata in another where the parties and subject-matter are the same, not only as respects matters actually presented to sustain or defeat the right asserted, but also as respects any other available matter which might have been presented to that end.
Grubb, 281 U.S. at 479, 50 S.Ct. at 378, 74 L.Ed. at 979.
The case at bar parallels Grubb. The appellants here seek to gain title to the land bordering McHugh Lane. That was the objective in Ingram-Clevenger. The parties in this case were also parties in Ingram-Clevenger. All theories of recovery should have been raised in the first action.
We consistently have applied a four element test to determine whether or not a second action is barred:
First, the parties or their privies must be the same; second, the subject-matter of the action must be the same; third, the issues must be the same, and must relate *508 to the same subject-matter; fourth, the capacities of the persons must be the same in reference to the subject-matter and to the issues between them ...
State ex rel. Sullivan v. School District (1935), 100 Mont. 468, 472, 50 P.2d 252, 253. See also Harris v. Harris (Mont.1980), 616 P.2d 1099; S W Co. v. John Wight, Inc. (1978), 179 Mont. 392, 587 P.2d 348; Smith v. County of Musselshell (1970), 155 Mont. 376, 472 P.2d 878.
Merely a cursory examination of the four elements shows the parties or their privies are the same. Certainly the subject matter, a 20 foot-wide strip of land on either side of McHugh Lane, is the same. The capacity of the persons in reference to McHugh Lane is unchanged. The only element of controversy is whether the issue is the same.
A careful analysis shows the justicible issue to be the same. Appellants contend McHugh Lane was never properly dedicated a county road, despite Ingram-Clevenger, which says, "McHugh Lane was a properly dedicated county road with a width of 100 feet", 636 P.2d at 1373. Judge Loble's well-phrased order is equally clear:
The statutes concerning abandonment of county roads, § 7-14-2601 et seq., MCA, contemplate that there must be a county road in existence before it can be abandoned. How can it be otherwise? A justicible controversy could not have existed in Ingram-Clevenger if McHugh was not an actual county road, 100 feet wide.
Clearly, there is a road, 100 feet wide.
Undaunted, the landowners now attempt to cloak themselves in a different theory of recovery, arguing the facts and purposes for which the first action was brought constitute separate claims and res judicata does not apply. This seems like a case of deja vu.
The facts are these: In 1980 the landowners petitioned the county commissioners to abandon 20 feet on either side of McHugh Lane. The county commissioners refused. An action for mandamus was issued wherein the district court directed the county commissioners to abandon part of the road. We reversed, holding the statutes under which abandonment is accomplished are discretionary, precluding mandamus. The question is, what was the purpose or objective of the landowners' first action? Certainly it was to force the county commissioners to abandon 20 feet on either side of McHugh Lane, not to have a determination of whether an action by the county commissioners was discretionary or mandatory.
In 1982, the same property owners brought an action claiming there really was no properly dedicated road, and even if there were a properly dedicated road, 20 feet on either side should have been declared not to be part of that road. Notwithstanding the issues are phrased differently this time around, the substance of the landowners' contention is they want the county commissioners to abandon 20 feet on either side of McHugh Lane. A cause of action cannot be split in an attempt to prevail under a different theory the second time around. Hughes v. Salo (Mont.1983), 659 P.2d 270, 275, 40 St.Rep. 289, 295-96.
I would affirm.
HUNT, J., joins in the foregoing dissent of HARRISON, J.
