
860 S.W.2d 202 (1993)
Juan Manuel Flores ULLOA, Individually, and as Next Friend and Guardian of the Person and Estate of Consuelo Flores Ulloa, Appellants,
v.
Manuel Flores DAVILA, Temporary Administrator of the Estate of Manuel Flores De Luna, and Concepcion Davila De Flores, Appellees.
No. 04-92-00656-CV.
Court of Appeals of Texas, San Antonio.
August 3, 1993.
Arturo C. Gonzalez, Gonzalez, Gonzalez & Gonzalez, Del Rio, David T. Emory, Law Office of Ralph Brown, San Antonio, for appellants.
Richard Tinsman, Tinsman & Houser, Inc., San Antonio, for appellees.
Before BUTTS, PEEPLES and RICKHOFF, JJ.


*203 OPINION
PEEPLES, Justice.
At stake in this litigation are a ranch and two certificates of deposit that once belonged to Manuel Flores De Luna. The adverse litigants are members of two competing family units: De Luna's wife and son from a 1929 ceremonial marriage, and his de facto wife and son from the late 1940s until his death in 1981. The overriding issue is whether the court erred in dismissing one litigant's counterclaim after approving a settlement between other litigants. We hold that the court erred in dismissing the counterclaim sua sponte and therefore the judgment must be reversed.
De Luna formally married Concepcion Davila de Flores (Concepcion) in 1929, but they eventually parted ways and he then lived with Consuelo Flores Ulloa (Consuelo) from sometime in the late-1940s until his death in 1981. De Luna fathered one male child by each of these two women: Manuel Flores Davila (Davila) was born to Concepcion in 1942, and Juan Manuel Flores Ulloa (Ulloa) was born to Consuelo in 1949.[1] It is undisputed that De Luna and Concepcion never divorced officially, and that Texas law does not recognize common-law divorce. See Estate of Claveria v. Claveria, 615 S.W.2d 164, 167 (Tex.1981). Therefore De Luna and Concepcion remained officially husband and wife from 1929 until his death in 1981, even though he and Consuelo cohabited as husband and wife from the 1940s until he died in 1981.
In November 1979, De Luna purchased a 1434-acre ranch for $1,018,140. The sellers took a vendor's lien and deed of trust, and De Luna placed two certificates of deposit worth $500,000 in a Del Rio bank. Twelve days later, De Luna deeded the ranch to Consuelo and instructed the bank to apply the interest earned on the CDs toward the ranch note. He also gave the bank instructions that when he died or became mentally incompetent the principal and interest were to belong to Consuelo. The gift deed to Consuelo called her "my beloved wife" and recited that she had been "a true and faithful companion throughout almost all of my life," and that the money in the CDs was in fact "her own money which she turned over to me." De Luna's written instructions to the bank contained similar statements.
After De Luna became mentally incompetent in 1980, Ulloa (his son by Consuelo) was appointed guardian of his estate. De Luna died in 1981 and ultimately the guardianship of the estate was closed in 1985. The probate court was made aware of the ranch and CDs, but Concepcion and her son Davila were not given notice of the proceedings and were unaware that De Luna had died.
In 1989 Concepcion and Davila filed two suits: one to set up an administration of assets not disposed of in the 1985 order closing the guardianship (i.e., the ranch and CDs), and the other to set aside the 1979 deed and CD transfer and recover them for Concepcion. The court appointed Davila as administrator. Consuelo and Ulloa answered the suits and challenged the court's jurisdiction to adjudicate title to the ranch, which they said had been at issue in the earlier guardianship proceeding. During the pretrial stage of the litigation, Consuelo became mentally incompetent and in 1992 the court appointed an attorney ad litem for her at the Davilas' request.
The Ulloas filed a statutory bill of review under TEX.PROB.CODE ANN. § 31 (Vernon 1980) and a counterclaim which: (1) challenged the earlier appointment of Davila as administrator of De Luna's estate, (2) challenged the court's jurisdiction on various grounds, (3) asserted collateral estoppel, limitations, adverse possession, and laches, and (4) sought a declaratory judgment that the ranch and CDs belonged to Consuelo.
On October 17, 1992 all attorneys appeared in court for a settlement conference, and the court approved a settlement between the Davilas and Consuelo's ad litem. There was strenuous objection from the attorneys that *204 Ulloa and Consuelo had hired earlier when she was competent; they protested and opposed the settlement, by written pleading and in open court at the hearing. But the court ruled that the ad litem was entitled to act for Consuelo and that the previously retained attorneys were not. The court approved the settlement and then dismissed Ulloa's counterclaim, apparently on the ground that he had no standing to pursue it because he had only an expectancy of inheriting from his mother.
Under point five, Ulloa argues that the court erred in summarily dismissing his counterclaim for declaratory judgment without hearing arguments or allowing him to present evidence. The record does show that after approving the settlement the court summarily dismissed the counterclaim without giving Ulloa an opportunity to present proof in support of it. Davila had not sought dismissal of the counterclaim through any of the procedural devices provided by Texas law for attacking a cause of action or a litigant's standing prior to trial. Davila filed no written motion for summary judgment, special exceptions, plea in abatement, or other motion seeking dismissal or similar relief. He simply raised the matter orally at the settlement hearing.
Because the Davilas nonsuited their claims against Ulloa, they argue that the court was therefore empowered to dismiss Ulloa's counterclaim. Concerning nonsuits, rule 162 says, "Any dismissal pursuant to this rule shall not prejudice the right of an adverse party to be heard on a pending claim for affirmative relief...." TEX.R.CIV.P. 162. If Ulloa's counterclaim had sought merely to negate the Davilas' affirmative claims the court's dismissal might have been correct. See BHP Petroleum Co. v. Millard, 800 S.W.2d 838 (Tex.1990).
But the counterclaim did more than merely resist Davila's right to recover or restate the defenses to that suit; it sought a declaration that the Ulloas were the lawful owners of the disputed property. See General Land Office v. OXY U.S.A., Inc., 789 S.W.2d 569, 570-71 (Tex.1990). And the statutory bill of review sought to set aside several of the court's earlier rulings that set the stage for the settlement and made it possible. Davila's nonsuit did not simply give up on these issues and concede them to Ulloa. By the nonsuit Davila abandoned his suit to divest Ulloa of the property, but he did not thereby concede the declaratory judgment, which sought to quiet title in the Ulloas and was utterly inconsistent with the settlement. Perhaps Ulloa lacked standing and lacked a justiciable interest, and perhaps his case had no merit. But he nevertheless had a right to be heard on his suit without suffering a summary dismissal. He was entitled to have his case presented to the trier of fact unless the issues were eliminated by summary judgment, special exception, or some other recognized pretrial procedure. See Gleason v. Coman, 693 S.W.2d 564, 567 (Tex.App.Houston [14th Dist.] 1985, writ ref'd n.r.e.); Garver v. First Nat'l Bank, 406 S.W.2d 797, 798-99 (Tex.Civ.App.Amarillo 1966, writ ref'd n.r.e.).[2]
Under Texas procedure, one litigant may defeat the other's claim for affirmative relief by several methods short of trial. But the Davilas did not invoke any of the available procedures that our law provides for attacking the factual or legal sufficiency of an opposing ground of recovery or defense, or the standing of the opposing litigant to bring suit.
If a litigant can refute one or more facts essential to his opponent's case, he may do so by motion for summary judgment under Tex.R.Civ.P. 166a. The rule itself requires that there be a written motion and twenty-one days' notice, and in addition the motion must specify the grounds. McConnell v. Southside Indep. School Dist., 858 S.W.2d 337 (Tex.1993); Roberts v. Southwest Texas Methodist Hosp., 811 S.W.2d 141, 144-46 (Tex.App.San Antonio 1991, writ denied). And a court may not render summary *205 judgment on a counterclaim in the absence of a motion for summary judgment seeking that relief. Young v. Hodde, 682 S.W.2d 236, 237 (Tex.1984).
Other procedures authorize dismissal when a pleading is legally insufficient. If a litigant can show that the opponent's pleading, assuming the pleaded facts are true, does not state a legally accepted ground of recovery or defense, the court may sustain a special exception and dismiss. See City of Round Rock v. Smith, 687 S.W.2d 300 (Tex. 1985). But the pleader has an absolute right to amend and try to cure the defect before suffering dismissal. See Massey v. Armco Steel Co., 652 S.W.2d 932, 934 (Tex.1983); Texas Dep't of Corrections v. Herring, 513 S.W.2d 6, 9-10 (Tex.1974). Neither of these recognized procedures justifies the dismissal order before us because the Davilas did not employ either of them to challenge as a matter of law the factual or legal viability of Ulloa's counterclaim.
Our law authorizes other pretrial dismissals of a case, but none apply to the situation before us. See, e.g., Tex.R.Civ.P. 165a (dismissal for want of prosecution); Tex.R.Civ.P. 215 (abuse of discovery); Johnson v. Lynaugh, 796 S.W.2d 705 (Tex.1990) (dismissal of frivolous or malicious inmate petition filed in forma pauperis). Even when a court holds a pretrial conference, it may not rule sua sponte on contested issues framed by a litigant's pleadings. See Tex.R.Civ.P. 166.
Here the court did not rule on the merits of Ulloa's counterclaim; it held he had no standing, that he lacked a justiciable interest. But when a litigant asserts that his opponent lacks a justiciable interest in a controversy, he must file a written plea in abatement and obtain a ruling. See Texas Indus. Traffic League v. Railroad Commission, 633 S.W.2d 821, 823 (Tex.1982). If the court grants the plea in abatement, before dismissing the case it must first give the pleader a chance to amend. Erbs v. Bedard, 760 S.W.2d 750, 753 (Tex.App.Dallas 1988, no writ); Atkinson v. Reid, 625 S.W.2d 64, 66 (Tex.App.San Antonio 1981, no writ); Texas Employers Ins. Ass'n v. Baeza, 584 S.W.2d 317, 321 (Tex.Civ.App.Amarillo 1979, no writ).
We hold that the court erred in dismissing Ulloa's counterclaim without prior notice or motion invoking a pretrial procedure justifying dismissal. This holding requires reversal of the agreed judgment which rests on the ad litem's settlement on behalf of Consuelo; so long as Ulloa's counterclaim and bill of review remain unresolved, the settlement cannot stand.
Ordinarily we would discuss issues likely to arise on remand. But the record shows that since the settlement Consuelo has died, and Ulloa is now guardian of her estate. In addition, before considering another proposed settlement the court will have to reassess the merits of the settlement in light of the changed tax considerations and the evidence presented in support of Ulloa's counterclaim and bill of review.
We note that both guardians ad litem and the courts asked to approve settlements they recommend must take great care to ensure that the ward's interests are fully protected. In particular, the court must be made aware of the facts that bear upon the fairness of the settlement. See Missouri-Kansas-Texas R.R. Co., 138 Tex. 1, 156 S.W.2d 265, 267 (1941); Greathouse v. Fort Worth & Denver City Ry. Co., 65 S.W.2d 762 (Tex.Comm'n App.1933, holding approved). It is especially important for courts to delve into the facts when the court-appointed ad litem has displaced counsel retained by the ward when she was still mentally competent, and the previously retained counsel opposes the settlement.
For the reasons stated, we reverse the judgment and remand the cause for further proceedings. We need not discuss Ulloa's contentions that the ad litem exceeded his authority in approving the settlement, and that the evidence did not support the reasonableness of the settlement.
NOTES
[1]  Because the father and both sons have the name Manuel Flores, we will refer to them individually as De Luna (the father), Davila (the first son), and Ulloa (the second son). We will sometimes refer to Concepcion and her son Davila collectively as the Davilas, and to Consuelo and her son Ulloa as the Ulloas.
[2]  As the Austin court said in a slightly different context, "We are not aware of any power in the trial court to dismiss sua sponte, and `with prejudice,' a pleaded cause of action." Dillard v. NCNB Texas Nat'l Bank, 815 S.W.2d 356, 358 (Tex.App.Austin 1991, no writ), overruled on other grounds, Amberboy v. Societe de Banque Privee, 831 S.W.2d 793, 797 (Tex.1992).
