
747 P.2d 48 (1987)
113 Idaho 639
Royal Von PUCKETT, Plaintiff-Appellant,
v.
The CITY OF EMMETT, Idaho, a municipal corporation; Michael John Priest, Emmett City Chief of Police; Dale Olson, Larry Downer, Clarence Mitchell, William Jewell, Tom Hewlett, and Larry Harshfield, Emmett City Council Members, and Rod Morgan, Mayor of the City of Emmett, Idaho, Defendants-Respondents.
No. 16534.
Supreme Court of Idaho.
October 30, 1987.
Rehearing Denied January 7, 1988.
*49 Vernon K. Smith, Boise, for plaintiff-appellant.
Quane, Smith, Howard & Hull, Boise, for defendants-respondents. Kathryn A. Sticklen argued.
BISTLINE, Justice.
In April 1979, Puckett, an Emmett police officer, observed a vehicle owned by Audrey and David Rhoton which displayed cancelled license plates. Puckett arrested the Rhotons. In July 1979, the Emmett City Attorney dismissed the charges against the Rhotons.
Two months later, in August 1979, Puckett persuaded the Gem County Prosecutor to file the same charges against the Rhotons. Despite the fact that misdemeanor charges cannot be refiled, Puckett illegally re-arrested the Rhotons on August 19, 1979. On August 20, 1979, the Emmett Chief of Police placed Puckett on informal probation.
The Chief of Police wrote a note stating that Puckett was on probation for six months at the end of which the note would be removed from his personnel file if there had been no problems with Puckett's performance.
The Rhotons filed an action in federal court against the city for the illegal arrest. Puckett was a named defendant, as also was the city. While the Rhotons' suit was pending, the city fired Puckett on June 2, 1980. Puckett sought unemployment compensation and was denied. During his appeal from that denial, the city contends it agreed not to contest the unemployment claim in return for Puckett's waiver of claims against the city. The city stipulated to Puckett's eligibility and his appeal was successful.
Then, in the Rhotons' federal action,[1] Puckett filed a crossclaim against the city. He alleged sweeping violations of "Title 42, Chapter 21" of the federal statutes. Judge Callister construed that claim liberally to state a claim only under 42 U.S.C. § 1983 for deprivation of due process rights under color of state law. R., p. 386. Prior to termination, Puckett had received no notice, nor was he given a hearing. Puckett prayed for relief including back wages, reinstatement, and elimination from his personnel file of any reference to the disciplinary action against him.
The parties filed cross-motions for summary judgment on Puckett's cross-claim. The case was submitted to the court upon briefs, affidavits, and oral argument. Two days before the court rendered its memorandum decision, Puckett filed a motion to amend his cross-claim to include a state law cause of action. The new claim alleged breach of the settlement agreement entered into during the course of the unemployment compensation proceedings and prayed for damages. It is this non-federal claim, or cause of action, that the City of Emmett seeks to extinguish through application of the doctrine of res judicata.
There is nothing in the record to show that Judge Callister ruled on this motion to amend. His opinion of April 29, 1983 makes no mention of it. Neither does an order of August 12, 1983 that denied Puckett's motion to reconsider. The sole issue at the summary judgment hearing was whether Puckett could prove the elements of a 42 U.S.C. § 1983 action against a municipality under the requirements of Monell v. New York City Dept. of Soc. Serv., 436 U.S. 658, 98 S.Ct. 2018, 56 L.Ed.2d 611 (1978). The court found that he could not, and dismissed his claim against the city.
Puckett appealed to the Ninth Circuit on or about September 6, 1983. The day after the Ninth Circuit filed its unpublished memorandum opinion affirming the district court judgment, Puckett refiled his state claim for breach of settlement agreement in our Third Judicial District Court of the State of Idaho, in and for Gem County. His complaint joined the chief of police, mayor and council members as defendants.
*50 The appeal taken to the Ninth Circuit did not include Judge Callister's failure to rule on Puckett's motion to amend. The opinion of the circuit panel stated briefly: "Breach of the settlement agreement is not an issue before this Court... . We do not address whether Puckett has a state law remedy for breach of contract against the City of Emmett." R. pp. 714-715.
The sole issue before Judge Goff, and on appeal, is whether the federal court decision which dismissed Puckett's federal claim pursuant to a motion for summary judgment, bars Puckett from asserting his state cause of action in state court. The able Third District judge, in a well-structured and thoughtful opinion, held that all elements of the doctrine of res judicata were satisfied and granted defendants' motion to dismiss.
However, the district court failed to fully explore this case in the federal law context of pendent jurisdiction[2] and did not properly apply the guidelines set out in United Mine Workers v. Gibbs, 383 U.S. 715, 86 S.Ct. 1130, 16 L.Ed.2d 218 (1966). For reasons discussed below, we must reverse and remand to the Third District Court for further proceedings.
This case requires us to examine the interplay between the concepts of res judicata and pendent jurisdiction. Res judicata is a judicially created doctrine. There is nothing in the U.S. Constitution, nor in our federal statutes, that requires state courts to give full faith and credit, and the preclusive effect of res judicata, to federal court judgments. See Ronan E. Degnan, "Federalized Res Judicata," 85 Yale Law Journal, 741, 755 (1976).
Res judicata, or claim preclusion, denotes that a valid, final judgment by a prior court, between the same parties or their privies, concludes the litigation as to all matters that were or should have been litigated in the first action. Joyce v. Murphy Land & Irrigation Co., 35 Idaho 549, 553, 208 P. 241, 242-43 (1922). The existence of a judgment by a prior court between the same parties or privies is not here at issue. The question we address today is whether Puckett's state law claim of breach of settlement agreement, raised by Puckett in federal court by means of a *51 motion to amend his complaint, was a matter which was or should have been litigated in the federal court action.
At this point the analysis becomes and remains an examination of the effect of federal pendent jurisdiction upon the doctrine of res judicata. The Restatement (Second) of Judgments (1982) has been cited with approval by this Court in Houser v. Southern Idaho Pipe & Steel, Inc., 103 Idaho 441, 446, 649 P.2d 1197, 1202 (1982) and Ramseyer v. Ramseyer, 98 Idaho 554, 556, 569 P.2d 358, 360 (1977). In Section 87, the Restatement takes the position based on leading commentators and the better reasoned cases, that "Federal law determines the effects under the rules of res judicata of a judgment of a federal court." Thus, our analysis must rest upon a review of federal case law.
The leading case is United Mine Workers of America v. Gibbs, 383 U.S. 715, 86 S.Ct. 1130, 16 L.Ed.2d 218 (1966). In Gibbs the court reviewed a federal district court decision which allowed a federal question claim and a state claim based on the common law of Tennessee to proceed to a jury verdict and judgment. The court found that the district court did not exceed its discretion in carrying the state claim forward. Id. 86 S.Ct. at 1140.
The Gibbs court analyzed pendent jurisdiction in terms of judicial power and judicial discretion. Federal courts, as courts of limited jurisdiction, have the power to hear a state claim when that claim and the federal one derive from a common nucleus of operative fact:
"... [I]f, ... a plaintiff's claims are such that he would ordinarily be expected to try them all in one judicial proceeding, then ... there is power in federal courts to hear the whole." Id. at 1138.
However, the court viewed the exercise of that power as a matter of judicial discretion, not of plaintiff's right. It delineated guidelines for the application of that discretion as follows:
That power need not be exercised in every case in which it is found to exist. It has consistently been recognized that pendent jurisdiction is a doctrine of discretion, not of plaintiff's right. Its justification lies in considerations of judicial economy, convenience and fairness to litigants; if these are not present a federal court should hesitate to exercise jurisdiction over state claims, even though bound to apply state law to them. [citation omitted]. Needless decisions of state law should be avoided both as a matter of comity and to promote justice between the parties, by procuring for them a surer-footed reading of applicable law. Certainly, if the federal claims are dismissed before trial, even though not insubstantial in a jurisdictional sense, the state claims should be dismissed as well.[3] Similarly, if it appears that the state issues substantially predominate, whether in terms of proof, of the scope of the issues raised, or of the comprehensiveness of the remedy sought, the state claims may be dismissed without prejudice and left for resolution to state tribunals. Id. p. 1139 (emphasis added).
Applying these principles to the facts of Puckett's case, it is clear that the federal district court had the discretionary power to hear his state law claim for breach of a settlement agreement. There was no challenge to the substantiality of his federal question cause of action under 42 U.S.C. § 1983 for denial of due process in the course of his termination. In addition, the state claim shared a common nucleus of operative fact with the federal claim. Both arose out of his termination by the Emmett City Police Chief. The city alleges that it offered to not contest Puckett's claim for unemployment compensation in exchange for Puckett's waiver of any claims he might have against the city. Clearly, both his procedural due process claim and the settlement agreement arose out of the alleged wrongful termination.
The question of whether the federal court would have exercised its discretion to hear the state claim is a bit, although not greatly, more problematic. This is the key *52 point in Puckett's appeal. Had the federal district court exercised its discretion to hear the state claim, then the claim was a matter which should have been litigated and would be now barred in a subsequent state court action. Had the federal court clearly declined to exercise its discretionary jurisdiction over the state claim, then there should be no bar to a subsequent state court action.
Such is the position taken by the authoritative Restatement (Second) of Judgments (1982). Comment "e" to § 25 states the following:
e. State and federal theories and grounds. A given claim may find support in theories or grounds arising from both state and federal law. When the plaintiff brings an action on the claim in a court, either state or federal, in which there is no jurisdictional obstacle to his advancing both theories or grounds, but he presents only one of them, and judgment is entered with respect to it, he may not maintain a second action in which he tenders the other theory or ground. If however, the court in the first action would clearly not have had jurisdiction to entertain the omitted theory or ground (or, having jurisdiction, would clearly have declined to exercise it as a matter of discretion), then a second action in a competent court presenting the omitted theory or ground should be held not precluded. (Emphasis added).
Illustration 10 gives the following example:
10. A commences an action against B in a federal court for treble damages under the federal antitrust laws. After trial, judgment is entered for the defendant. A then seeks to commence an action for damages against B in a state court under the state antitrust law grounded upon substantially the same business dealings as had been alleged in the federal action. Even if diversity of citizenship between the parties did not exist, the federal court would have had "pendent" jurisdiction to entertain the state theory. Therefore unless it is clear that the federal court would have declined as a matter of discretion to exercise that jurisdiction (for example, because of the federal claim, though substantial, was dismissed in advance of trial), the state action is barred. (Emphasis added).
Illustration 10 is, in turn, clearly based upon the key language from Gibbs, supra, cited above at pages 641-642, 747 P.2d at pages 50-51. The Reporter's Note demonstrates the source of Illustration 10:

United Mine Workers v. Gibbs, 383 U.S. 715, 86 S.Ct. 1130, 16 L.Ed.2d 218 (1966), adopts a transactional approach with respect to the "pendent" jurisdiction of the federal courts referred to in Illustration 10. The Gibbs decision, in other words, takes the general position that a federal court having competency of an action because it arises under federal law may also hear and determine any demands based on state law which spring from the same transaction, or common nucleus of operative fact. See Wright, Federal Court § 19 (3d ed. 1976). As the Court in Gibbs made clear, however, such jurisdiction is discretionary, and in some instances should properly be declined. See 383 U.S. at 726-29, 86 S.Ct. at 1139-1140, 16 L.Ed.2d at 228-230; Wright, supra. If in a given case it is clear that a federal court, applying the criteria elaborated in Gibbs, would not have entertained the state theory, the state action should not be barred. (Citations omitted, emphasis added).
Wright and Miller's treatise on federal practice and procedure takes a similar position. The authors distinguish three situations based on whether both federal and state courts would have full or partial jurisdiction over the federal and state claims. The appropriate setting in Puckett's case is situation number two, where the state court has full jurisdiction over both claims[4] whereas the federal court requires the doctrine *53 of pendent jurisdiction in order to hear the state claim:
In the second situation the state court would have full jurisdiction, while the federal court could assert jurisdiction over all theories by combining federal question jurisdiction with pendent jurisdiction. If the first action is brought in state court, there is no reason to deny claim preclusion. If the first action is brought in federal court on the federal theories alone, the major argument for refusing to preclude a second action in state court on the state theories is that the plaintiff should be free to take each theory to the court best equipped to handle it. This argument is attractive, but it is no more persuasive in this situation than in the situation of independent diversity jurisdiction. A subsidiary argument for refusing to preclude a second action in state court would be that assertion of pendent jurisdiction is a discretionary and uncertain thing. The response is persuasively made that the plaintiff should be required to invoke pendent jurisdiction unless it is clearly inappropriate. Assertion of the state theories with the federal theories will put the federal court in a position to determine whether the interests of all concerned are better advanced by a single federal action or by parallel state and federal actions. If the federal court refuses to accept pendent jurisdiction, there would be no preclusion. This is the position adopted by the Restatement. Wright, Miller & Cooper, 18 Federal Practice and Procedure § 4412, pp. 95-96 (1981).
The lower federal courts, particularly the Ninth Circuit, have consistently followed the Gibbs principles which guide the exercise of the trial court's discretion. Specifically relevant in Puckett's case is the following guideline from Gibbs quoted above at p. 642, 747 P.2d at p. 51:
"Certainly, if the federal claims are dismissed before trial, even though not insubstantial in a jurisdictional sense, the state claims should be dismissed as well." 86 S.Ct. at 1139.
Significantly, the Gibbs court cited Wham-O-Mfg. Co. v. Paradise Mfg. Co., 327 F.2d 748, 752-754 (9th Cir.1964), in support of the above proposition. In Wham-O, a three judge panel reviewed a district court decision which dismissed a federal patent infringement claim upon a defense motion for summary judgment and dismissed a pendent state claim for unfair competition as well.
The court found that the district court properly exercised its discretion in dismissing the state claim. It reasoned that, unlike Hurn v. Oursler, 289 U.S. 238, 53 S.Ct. 586, 77 L.Ed. 1148 (1933) (the leading case on pendent jurisdiction prior to Gibbs), where dismissal was ordered after sixteen days of trial, neither the plaintiff's energy nor the court's time had been so occupied. 327 F.2d at 753.
The court concluded with the following paragraph:
The district court dismissed the unfair competition claim, but since the merits were not reached, the dismissal should have been of the complaint and not the claim. This will permit plaintiff, if it so desires, to litigate the competition claim in an appropriate state court. The judgment is modified to recite that plaintiff's complaint as to the second count, is dismissed without prejudice to litigate any such cause of action in an appropriate state forum. 327 F.2d at 753. (Emphasis added.)
Following the Supreme Court's adoption of the Wham-O court's position in Gibbs, federal courts, in particular the Ninth Circuit, have consistently followed the rule that where a federal claim is dismissed pursuant to a defense motion for summary judgment, the pendent state claim should ordinarily be dismissed as well. See, e.g. 49er Chevrolet, Inc. v. General Motors Corp., 803 F.2d 1463, 1469 (9th Cir.1986); Kelly v. International Brotherhood of Electrical Workers, 803 F.2d 516, 519 (9th Cir.1986); Schultz v. Sundberg, 759 F.2d 714, 718 (9th Cir.1985); Rapid Transit Advocates v. Southern California Rapid Transit District, 752 F.2d 373, 379 (9th Cir.1985), ("Since no federal claim remained, *54 the district court properly dismissed the pendent state claims and properly refused to amend the complaint to allege additional claims under state law.")
Other circuits have applied the same principle, see, e.g., Baltimore Orioles v. Major League Baseball Players, 805 F.2d 663, 682 (7th Cir.1986), ("[W]hen federal claims are disposed of before trial, the state claims should be dismissed without prejudice almost as a matter of course."). Tully v. Mott Supermarkets, Inc., 540 F.2d 187, 196 (3rd. Cir.1976). ("If it appears that the federal claim could be disposed of on a motion for summary judgment ..., then the court should ordinarily refrain from exercising jurisdiction in the absence of extraordinary circumstances.") Kavit v. A.L. Stamm & Co., 491 F.2d 1176 (2d Cir.1974); Morris v. Frank IX & Sons, Inc., 486 F. Supp. 728, 734, (W.Dist.Va. 1980) (applying the 4th Circuit rule).
The main proviso is that where substantial judicial time and resources have been spent on the state claims, jurisdiction over them will be retained even if the federal cause of action is dismissed upon summary judgment. See e.g., Meyer v. California and Hawaiian Sugar Co., 662 F.2d 637, 640 (9th Cir.1981). Obviously, the guiding principles are those of judicial economy and avoiding needless decisions of state law by a federal court. See Gibbs, supra, 86 S.Ct. at 1139.
In Puckett's case, his federal claim under 42 U.S.C. § 1983 for denial of procedural due process in the course of his termination from employment was dismissed pursuant to a defense motion for summary judgment. Judge Callister ruled that Puckett failed to satisfy the requirements of Monell v. New York City Dept. of Soc. Serv., 436 U.S. 658, 98 S.Ct. 2018, 56 L.Ed.2d 611 (1978) R., p. 388. Two days before Judge Callister's opinion issued, Puckett moved to amend his complaint to include a state cause of action. Judge Callister never ruled on the record regarding this motion.
It appears that the federal district court did not expend a great deal of judicial resources on the federal claim, and, obviously, none on the state claim. The federal case was submitted upon briefs, oral argument, and affidavits. Some discovery had taken place. The court's involvement was no more than that required for a typical summary judgment hearing. While the clerk's record before this Court is not insubstantial, the vast majority of it was generated after Judge Callister dismissed Puckett's 42 U.S.C. § 1983 action.
As noted above, Judge Callister did not rule on the record on Puckett's motion to amend his complaint to include his state law claim. Accordingly, neither the court's memorandum opinion and order of August 8, 1983 nor the order denying reconsideration made any mention of the state cause of action. Curiously, in a case involving similar considerations decided six weeks earlier, Judge Callister did favor the record with an unambiguous ruling that, had it been made in the instant case, would have precluded this appeal:
"... [T]he Court finds that the state issues predominate in terms of the comprehensiveness of the remedy sought. There is a real likelihood of jury confusion in treating these divergent legal theories of relief. Therefore, the Court will dismiss the plaintiff's pendent state claims contained in count two and count five of plaintiff's amended complaint without prejudice to plaintiff's ability to file said counts in state court. [citation omitted]. (Emphasis added). James v. Kid Broadcasting Corp., 559 F. Supp. 1153, 1157 (D.C.Idaho 1983).
Judge Callister's failure to so rule on the record in Puckett's case was in all likelihood a mere oversight. However, given the consistent rule applied by the Ninth Circuit in similar cases, it is clear what the court would and should have done. Even if leave to amend had been granted,[5] the court in a proper exercise of discretion would have dismissed Puckett's state law claim along with his federal question cause of action.
*55 As discussed above, the consistent Ninth circuit rule derived from Wham-O, as adopted by the Gibbs court, is to ordinarily dismiss pendent state law claims when the accompanying federal cause of action is dismissed pursuant to a defense motion for summary judgment. The impact of this rule upon the doctrine of res judicata is this: when a court having jurisdiction would clearly have declined to exercise it as a matter of discretion, a second action on the dismissed or omitted claim should not be precluded. See Restatement (Second) of Judgments (1982), § 25, Comment "e", supra and Wright and Miller, supra at pp. 95-96.[6]
For the foregoing reasons, we reverse the district court and remand directing the court to allow Puckett to proceed with his state law cause of action.
DONALDSON[*] and HUNTLEY, JJ., concur.
SHEPARD, C.J., and BAKES, J., concur in result.
NOTES
[1]  The Rhotons eventually settled with the city leaving only Puckett's crossclaim before the Court. R., p. 384.
[2]  Technically Puckett's state law claim might be classified as ancillary, rather than pendent. Pendent claims are state claims which arise from the same factual setting as the federal cause of action and are joined in a plaintiff's complaint. Ancillary claims arise out of the same transaction but are asserted, after the original complaint is filed, usually by one other than the original plaintiff. Blake v. Pallan, 554 F.2d 947, 956-7, (9th Cir.1977), footnote 11.

However, it is doubtful whether the classification makes any difference for the purpose of analyzing the res judicata issue before this Court. Justice Rehnquist has observed:
Given the complexities of the many manifestations of federal jurisdiction, together with the countless factual permutations possible under the Federal Rules, there is little profit in attempting to decide, for example, whether there are any `principled' differences between pendent and ancillary jurisdiction. Aldinger v. Howard, 427 U.S. 1, 96 S.Ct. 2413, 2419-20, 49 L.Ed.2d 276 (1976).
This position was re-affirmed by the Court two years later, "... the Court of Appeals was correct in perceiving that Gibbs [pendent claim] and this case [ancillary claim] are two species of the same generic problem: Under what circumstances may a federal court hear and decide a state-law claim arising between citizens of the same state?" Owen Equipment & Erection Co. v. Kroger, 437 U.S. 365, 98 S.Ct. 2396, 2401, 57 L.Ed.2d 274 (1978).
Significantly, federal courts have applied the Gibbs guidelines, infra, in exercising their discretion to hear or to dismiss ancillary claims, "Analogizing to Gibbs and its progeny, several decisions have concluded that federal courts possess similar discretion to dismiss claims whose jurisdiction was purely ancillary when the main claim was dismissed early in the litigation." 13 Wright, Miller & Cooper, Federal Practice and Procedure 2d § 3523, p. 105 (1984). See cases cited therein; see also, U.S. v. City of Twin Falls, Idaho, 806 F.2d 862 (9th Cir.1986) and Blake v. Pallan, 554 F.2d 947 (9th Cir.1977).
Here Puckett's claims were ancillary in that they were raised by a non-plaintiff after the filing of plaintiff's complaint. See Blake v. Pallan, supra. However, his claims are typical of one who prosecutes a wrongful termination case. Once the Rhotons settled their action with the city of Emmett, Puckett's position evolved into one more similar to that of a plaintiff than a cross-claiming co-defendant. Thus, the facts of this case establish how the line between ancillary and pendent claims can become extremely fuzzy, demonstrating the insight of Justice Rehnquist's observation in Aldinger v. Howard, supra. For the sake of convenience, Puckett's state-law claim will be referred to as "pendent."
[3]  Citing Wham-O-Mfg. Co. v. Paradise Mfg. Co., 327 F.2d 748, 752-754 (9th Cir.1964).
[4]  State courts have concurrent jurisdiction to hear actions under 42 U.S.C. § 1983, Allen v. McCurry, 449 U.S. 90, 101 S.Ct. 411, 66 L.Ed.2d 308 (1980).
[5]  See Rapid Transit Advocates, supra, 752 F.2d at 379 where the court refused to amend the complaint to allege state claims.
[6]  See also, the excellent Note, "The Res Judicata Implications of Pendent Jurisdiction," 66 Cornell Law Review 608 (1981).
[*]   DONALDSON, J., sat and participated fully in the decision and opinion prior to his death.
