
328 S.C. 347 (1997)
491 S.E.2d 692
PLUM CREEK DEVELOPMENT COMPANY, INC., Respondent,
v.
THE CITY OF CONWAY, a Municipal Corporation, Appellant.
No. 2710.
Court of Appeals of South Carolina.
Heard May 7, 1997.
Decided August 18, 1997.
Rehearing Denied September 18, 1997.
*348 W. Cliff Moore, III and Andrew F. Lindemann, both of Ellis, Lawhorne, Davidson & Sims, Columbia, for appellant.
John P. Henry, The Thompson Law Firm, Conway, for respondent.
CURETON, Judge:
This appeal involves a suit for damages brought by Plum Creek Development Company, Inc. (Plum Creek) against the City of Conway (City) regarding the failure of the City to provide water and sewer services to Plum Creek. The trial court awarded Plum Creek partial summary judgment on the issue of liability. The City appeals. We reverse and remand.

FACTS
The facts of this case are largely undisputed. The controversy between the parties began with a request by the respondent, *349 Plum Creek, to the City to furnish water and sewer services to its planned development. The City refused to provide utility services to the development unless the development was first annexed into the City of Conway. Plum Creek responded that the City had unconditionally obligated itself by agreement to provide the services.
In July 1992, Plum Creek sued the City challenging the City's position as unconstitutional, and asserting both a breach of a third-party contract and breach of an easement agreement. Plum Creek also alleged it had no adequate remedy at law and requested a writ of mandamus, costs and attorney fees. After the filing of its complaint, Plum Creek threatened to amend its complaint to request money damages against the City. The trial court in the mandamus action found the City had breached a third-party beneficiary contract[1] between Grand Strand Water and Sewer Authority and the City to provide water and sewer to Plum Creek. Finding Plum Creek had no adequate remedy at law, the court granted the writ of mandamus. The City appealed that decision to the Supreme Court and the Supreme Court affirmed in Memorandum Order Number 94-MO-183, filed July 15, 1994.
In August 1994, Plum Creek initiated the instant action requesting money damages resulting from the City's unlawful denial of water and sewer service. Plum Creek premises its right to damages on the breach of the contract between Grand Strand Water and Sewer Authority and the City. Plum Creek also asserted causes of action based on breach of two easement agreements. These are the same causes of action advanced in the mandamus action. Among the defenses asserted by the City is that the mandamus action bars the present action under principles of res judicata. On July 6, 1995, the City filed a Motion for Summary Judgment claiming entitlement to judgment in its favor based on res judicata. Plum Creek followed with a motion for summary judgment *350 asserting the liability of the City had been determined in the mandamus action.
On July 1, 1996, the trial court issued its order granting Plum Creek's motion as to liability, but denied the City's motion finding the mandamus action did not involve the same causes of action as those involved in the damages action. Thus, the court ruled the prosecution of the mandamus action by Plum Creek did not bar the instant action for damages.

ISSUE ON APPEAL
The sole issue on appeal is whether principles of res judicata resulting from the prior mandamus action preclude the bringing of this action for damages.

DISCUSSION/ANALYSIS
To establish res judicata, three elements must be shown: (1) identity of the parties, (2) identity of the subject matter, and (3) adjudication of the issue in the former action. Riedman Corp. v. Greenville Steel Structures, Inc., 308 S.C. 467, 419 S.E.2d 217 (1992). Res judicata also bars subsequent actions by the same parties when the claims arise out of the same transaction or occurrence that was the subject of a prior action between those parties. Sub-Zero Freezer Co. v. R.J. Clarkson Co., 308 S.C. 188, 417 S.E.2d 569 (1992) (citing Jaynes v. County of Fairfield, 303 S.C. 434, 401 S.E.2d 183 (Ct.App.1991)). See also Riedman, 308 S.C. at 469, 419 S.E.2d at 218.
It is undisputed that the parties are the same in both actions. The critical question presented is whether the subject matter of the mandamus action and the instant action for damages embrace the same cause of action. The test utilized by this court for comparing two causes of action is to determine whether the primary right and duty and the delict or wrong are the same in both actions. Jimmy Martin Realty Group, Inc. v. Fameco Dist., 300 S.C. 192, 386 S.E.2d 803 (Ct.App.1989); Nunnery v. Brantley Constr. Co., Inc., 289 S.C. 205, 209-10, 345 S.E.2d 740, 743 (Ct.App.1986) (citing Griggs v. Griggs, 214 S.C. 177, 51 S.E.2d 622 (1949)).
We conclude the subject matter in the prior mandamus action and instant suit is the same. Clearly, Plum Creek's right to mandamus and its right to damages grow out of the *351 same transaction or occurrence. The question then presented is whether or not the two causes of action are the same. For application of the doctrine of res judicata, it is not necessary that the two actions be identical with respect to the relief sought. 46 Am.Jur.2d Judgments, § 412 (1969).
In the instant action, Plum Creek advances causes of action for breach of contract and breach of easement agreement. The same causes of action were alleged in its complaint for mandamus. The only difference between the two actions is in the relief sought. The trial court distinguished the two actions finding the issue involved in the mandamus proceeding was the "duty of [the City] to provide water and wastewater utility service." The court concluded that there "was no cause of action for damages in the prior action. Only a remedial writ was sought."
Res judicata bars not only issues litigated in a prior action, but issues that could have been litigated. Hilton Head Ctr. of South Carolina, Inc. v. Public Serv. Comm'n, 294 S.C. 9, 362 S.E.2d 176 (1987); Jimmy Martin Realty Group, Inc. v. Fameco Dist., 300 S.C. 192, 386 S.E.2d 803 (Ct.App.1989). Nothing prevented Plum Creek from recovering its damages in the mandamus action. In fact, Rule 65(f)(2), SCRCP specifically provides for the recovery of damages in mandamus actions. Moreover, Plum Creek's sole officer and director testified the damages sought in this suit are the same damages referred to by its attorney in a threatened amendment to its mandamus complaint to assert damages in that action. The fact Plum Creek did not seek to recover all of the relief to which it was entitled in the mandamus proceeding does not preclude the bar of res judicata. Nunnery v. Brantley Construction Co., Inc., 289 S.C. at 210, 345 S.E.2d at 743; see also Foran v. USAA Cas. Ins. Co., 311 S.C. 189, 427 S.E.2d 918 (Ct.App.1993) (res judicata barred second cause of action because the rights asserted in the second cause of action existed when the judgment was entered in the first action). Moreover, although Rule 42(b), SCRCP, provides that once a cause of action has been pled, the court may order separate trials of multiple issues under certain circumstances, a party may not of his own volition split his cause of action so as to make it the subject of several causes of action without the consent of the opposing party. Nunnery, 289 S.C. at 209, 345 S.E.2d at 743; cf. 52 Am.Jur.2d Mandamus, § 62 (1970) (the *352 bringing of a mandamus proceeding in which a plaintiff has, as a part of his remedy, the right to recover damages he has sustained through the wrongdoing of the defendant, precludes the maintenance of a subsequent action for damages).[2]

CONCLUSION
We therefore conclude the trial court erred in concluding the judgment in the prior mandamus action which essentially involved a breach of contract did not preclude the instant action for damages. Accordingly, the order of the trial court is reversed and the case remanded to the trial court for entry of summary judgment in favor of the City.
REVERSED AND REMANDED.
CONNOR and STILWELL, JJ., concur.
NOTES
[1]  The third-party agreement referred to by the trial court is a "Water and Waste Water Service Area Agreement" entered into between the City of Conway and Grand Strand Water & Sewer Authority which the court found obligated the City to serve the subject property with water and wastewater utility services.
[2]  We are aware of Plum Creek's contention that some of its damages resulted from the City's failure to immediately comply with the writ of mandamus and that these damages, therefore, were not ascertainable prior to the issuance of the writ. We note, however, that the question of possible indemnification through compensatory contempt proceedings is not before us for review inasmuch as Plum Creek has not pursued this avenue of relief. Cf. Dorchester County Sch. Dist. v. Dorchester County Council, 289 S.C. 475, 347 S.E.2d 93 (1986) (mandamus may be enforced through contempt); Curlee v. Howie, 277 S.C. 377, 287 S.E.2d 915 (1982) (granting a monetary award to offended party in a compensatory contempt proceeding and holding: "the goal is to indemnify the plaintiff directly for harm the contemnor caused by breaching the [court order]" and "to restore the plaintiff as nearly as possible to his original position.").
