
552 S.W.2d 936 (1977)
F. E. SAWYER et al., and Donley County Hospital District, Appellants,
v.
George W. SMITH, Appellee.
No. 5667.
Court of Civil Appeals of Texas, Waco.
June 16, 1977.
Rehearing Denied July 7, 1977.
*937 Michael R. Sanders, Lovell, Lyle & Renfer, Clarendon, Hal Miner, Amarillo, for appellants.
John Mozola, Underwood, Wilson, Sutton, Berry, Stein & Johnson, Amarillo, for appellee.
HALL, Justice.
This is an appeal from a summary judgment in case number 3530 (# 3530) in the 100th Judicial District Court holding that the judgment in case number 3521 (# 3521) in that Court is res judicata of the dispute between the parties in # 3530. We affirm.
The parties to this appeal are appellant Donley County Hospital District (District) which initiated # 3521 and was a defendant in # 3530; appellants F. E. Sawyer and others (Plaintiffs) who are citizens and resident freeholders and taxpayers in District and who were Plaintiffs in # 3530; and appellee George W. Smith (Smith) who is a medical doctor and who was a defendant and cross-plaintiff in both cases.
Article 4494, Vernon's Tex.Civ.St., provides for the joint establishment and operation of a hospital by a county and a city. Our record shows that on November 20, 1956, Adair Hospital, which was a charitable corporation in the City of Clarendon, became a city-county hospital operated by the City of Clarendon and Donley County within the provisions of that statute. On that day the Board of Managers of the hospital executed a contract with appellee Smith under which Smith was made manager of the hospital at a salary of $12,000.00 per year, and was granted free use of the hospital and its equipment for his private practice. The contract was effective for 10 years beginning October 1, 1956, and was renewable in 10-year terms until October 1, 1986, unless terminated by Smith under circumstances available to him. Smith has never exercised his option to terminate.
By reason of Acts 1969, 61st Leg., p. 2035, ch. 699, effective June 12, 1969, (see note, Article 4494q., Vernon's Tex.Civ.St.) District was created and became the city-county hospital's successor. Thereafter, a dispute arose between District and Smith as to their rights and responsibilities under the contract between Smith and the city-county hospital in the light of the provisions of this Act and District filed # 3521 against Smith and the Adair Hospital Corporation to void the contract and oust Smith as manager of the hospital, and for judgment vesting title to all the hospital property in District. Smith filed a cross action for a declaration that the contract was valid and binding on District for several reasons under the Act including ratification of the contract by District, and for certain money damages. Additionally, Smith filed a third-party suit against John Jones and others, charging them with malicious interference with his contract with District. Later, Plaintiffs filed # 3530 (on behalf of themselves and all other property taxpayer-voters of District) against District and Smith, alleging that the contract relied upon by Smith and the ratification pleaded by him in # 3521 were both invalid because they violated the Act creating District in several particulars, were without consideration, and were beyond the powers of the Board of Managers of District. They prayed for an injunction preventing District from recognizing the contract and preventing Smith from using *938 the building or other property of District and from accepting funds from District. Smith answered with a general denial, a special plea that the contract and District's ratification were valid, and filed a cross action against Plaintiffs and a third-party claim against John Jones and others seeking actual and punitive damages against all of them on allegations that they were maliciously interfering with his contract with District. Thereafter, Plaintiffs filed motions to intervene in # 3521, and to consolidate both cases. These motions were never acted upon by the Court.
Such was the state of the pleadings when on March 5, 1973, District and Smith executed a compromise-settlement agreement, and when on March 7, 1973, judgment was rendered in # 3521 on the settlement agreement.
The settlement agreement recites that District and Smith had compromised and settled all controversies between them in both # 3521 and # 3530 "and all controversies between them, whether or not involved in either of [those] cases" in the following manner: District agreed to pay Smith $48,351.51, payable in four equal annual installments beginning on March 1, 1974, and agreed to fix a tax rate and levy and collect the tax each year to pay the installments; Smith would not recover any other sum "on account of anything involved in the cases," and District would not recover any sum from Smith; judgment would be entered in # 3521 that District take nothing against Adair Hospital or Smith as to the hospital premises claimed by District; Smith agreed to release District, and District agreed to release Smith "under or on account of that contract dated November 20, 1956, by and between the Board of Managers of Adair Hospital and George W. Smith"; and Smith agreed that if # 3530 should be dismissed with prejudice, then he would dismiss his cross actions and his third-party claims in both cases against Plaintiffs and John Jones and his group. Additionally, the last three paragraphs of the settlement agreement provided as follows:
"14. The parties hereto recognize that George W. Smith claims and asserts that he is entitled to recover from Donley County Hospital District sums many times over and greatly in excess of the aforesaid sum, and Donley County Hospital District claims that it is not indebted to George W. Smith, also that there is a bona fide dispute and controversy between the parties as to the contract hereinabove referred to; and this agreement and the settlement herein provided for is the settlement of a bona fide dispute and controversy between Donley County Hospital District and George W. Smith.
"15. The agreement herein contained of and by Donley County Hospital District and George W. Smith shall be implemented, supported and augmented by a judgment or judgments entered in the aforesaid causes....
"16. Donley County Hospital District shall pay all costs in Cause No. 3521."
The judgment rendered in # 3521 recites that District, Smith, and Jones and his group were before the Court. It tracks the settlement agreement and contains these orders:
1. The settlement agreement was approved by the Court.
2. Smith shall recover $48,351.51 from District payable in four equal annual installments beginning March 1, 1974.
3. District shall each year fix, levy, and collect a tax sufficient over and above its other expenses to pay Smith's money judgment.
4. District and Smith are both released from any claims by the other on account of the contract between Smith and Adair Hospital dated November 20, 1956.
5. Except as set forth in the judgment, neither District nor Smith shall recover any sum from the other on account of anything involved in this lawsuit.
6. District shall take nothing against Adair Hospital or Smith as to the Hospital property.
7. District shall pay all court costs.

*939 8. Writs shall issue in favor of Smith to enforce his money judgment if District defaults in payment.
9. Smith's third-party complaint against John Jones and others was dismissed with prejudice.
On the same day that judgment was rendered in # 3521 (March 7, 1973) judgment was also rendered in # 3530 which purported to dispose of that case by agreement of the parties.
On April 6, 1973, the court ordered the judgments in both cases set aside. On April 13, 1973, Smith filed motions to reinstate both judgments. This motion was contested by Plaintiffs in # 3530. On June 25, 1973, both judgments were reinstated by the Court. On direct appeal by Plaintiffs the order reinstating # 3530 was set aside by the appellate court on the holding that "the basis for an agreed judgment no longer existed since Plaintiffs did not agree to the judgment of dismissal, their disagreement being evident by their opposition to the motion to reinstate." See, Sawyer v. Donley County Hospital District, 513 S.W.2d 106, 109 (Tex.Civ.App.Amarillo 1974, no writ). However, the order of reinstatement in # 3521 was not appealed, and the reinstated judgment in that case became final.
Thereafter by divers pleadings in # 3530 against District, Plaintiffs, and John Jones and others, Smith sought as alternative remedies either (1) a declaration that the judgment in # 3521 was res judicata of the relief Plaintiffs and District sought in # 3530, or (2) a judgment against Plaintiffs and Jones and the others for actual and punitive damages for malicious interference with his contract. Later, Smith moved for summary judgment in # 3530 asserting that under the doctrines of res judicata and collateral estoppel all issues of fact and law in the case had been finally resolved by the judgment in # 3521, and praying for a declaration "that all parties to this cause are bound by the final judgment in cause # 3521" and that he be granted a nonsuit on his action for money judgment against Plaintiffs and Jones and the others. These pleadings and the motion were duly controverted by the other parties. On January 27, 1976, the motion was granted and judgment was rendered as follows:
1. The judgment in # 3521 "is a valid judgment not subject to collateral attack by the parties thereto or by any citizens, residents, or taxpayers of the Donley County Hospital District," and "all parties to this Cause 3530 are bound by the final judgment in Cause 3521";
2. Plaintiffs take nothing;
3. District takes nothing;
4. Smith is granted a nonsuit on his actions against Plaintiffs and Jones and the others; and
5. Costs are taxed against Plaintiffs.
District and Plaintiffs perfected this appeal from the summary judgment.
The record shows that between the time the judgment in # 3521 was set aside and the time it was reinstated, District's Board of Directors voted to contest the reinstatement. District states in its brief that this dissatisfaction with the judgment by District was conveyed to the Court before the reinstatement, although this knowledge by the Court is not established by the record. Nevertheless, Smith does not dispute the statement, and treats the fact as established. Based upon this fact, District asserts that the agreed judgment in # 3521 is void because District was not consenting to it at the time it was reinstated. We overrule this contention.
A valid consent judgment cannot be rendered by a court when consent of a party to it is wanting. And the fact that consent might have existed at some time prior to judgment is not sufficient. It "must exist at the very moment the court undertakes to make the agreement the judgment of the court," else the judgment is invalid and subject to being set aside. Burnaman v. Heaton, 150 Tex. 333, 240 S.W.2d 288, 291 (1951). However, if a party to the cause wishes to contend that he did not in fact agree to the judgment, he must do so by a direct attack upon the judgment *940 and cannot do so in a collateral proceeding. Cannon v. Hemphill, 7 Tex. 184, 197 (1851); Brennan v. Greene, 154 S.W.2d 523, 526 (Tex.Civ.App.San Antonio 1941, writ ref'd).
Plaintiffs say the judgment in # 3521 cannot be res judicata as to them because they were never parties in that case. We disagree. It is undisputed in the record that Plaintiffs are citizens and resident taxpayers of District, and that they brought suit # 3530 in their representative capacity as such. Absent fraud or collusion, it is the rule that a judgment for or against a unit of government "is binding and conclusive upon all residents, citizens, and taxpayers in respect to the matters adjudicated which are of general and public interest," because they are virtually represented in the litigation. Cochran County v. Boyd, 26 S.W.2d 364, 365-366 (Tex.Civ.App.Amarillo 1930, writ ref.); Allied Van Lines v. Central Forwarding, 535 S.W.2d 412, 413 (Tex.Civ.App.Waco 1976, writ ref'd n. r. e.). This rule controls here.
Plaintiffs assert the consent judgment was merely a ministerial act of the Court and cannot serve as the basis for a valid plea of res judicata. This is not so. A consent judgment has substantially the same effect as any other judgment rendered in ordinary course. It is equally conclusive as to the matters adjudicated, is not subject to collateral attack except upon jurisdictional grounds, and is entitled to full effect as res judicata. Pollard v. Steffens, 161 Tex. 594, 343 S.W.2d 234, 239 (1961); Wagner v. Warnasch, 156 Tex. 334, 295 S.W.2d 890, 893 (1956); State v. Swift & Co., 187 S.W.2d 127, 136 (Tex.Civ.App. Austin 1945, writ ref'd); 34 Tex.Jur.2d 529, Judgments, § 476.
In separate points, Plaintiffs and District assert that the judgment in # 3521 is void and therefore subject to collateral attack because it (and the settlement agreement upon which it is based) violates a "pay-as-you-go" provision in the Act creating District, and also violates the method of payment of debts prescribed by the Act. These questions were necessarily decided in Smith's favor and adversely to Plaintiff's and District's present argument when the judgment in # 3521 was rendered. The order reinstating the judgment shows that these issues were again considered by the Court and again determined in favor of Smith at the time of reinstatement. The Court had jurisdiction under the pleadings of the parties in # 3521 to decide these questions. His decisions thereon became final. Whether they were correctly or erroneously decided by the Court in its orders is not important to the application of res judicata. State v. Swift & Co., 187 S.W.2d 127, 137 (Tex.Civ.App.Austin 1945, writ ref'd). See also, Martin v. Sheppard, 145 Tex. 639, 201 S.W.2d 810, 812 (1947); Security Trust Co. of Austin v. Lipscomb County, 142 Tex. 572, 180 S.W.2d 151, 157 (1944).
All remaining points and contentions are without merit. They are overruled.
The judgment is affirmed.
