OPINION
COHEN, Judge:
This case is before us on respondent's motion to dismiss for lack of jurisdiction on the ground that petitioners' claim for administrative costs is barred by the doctrine of res judicata. Petitioners were residents of Hillsborough, California, when their petition was filed.
Unless otherwise indicated, all section references are to the Internal Revenue Code as amended, and all Rule references are to the Tax Court Rules of Practice and Procedure.
Background
On August 2, 1989, respondent sent a notice of deficiency in which he determined a deficiency in petitioners' income tax and additions to tax for 1986. Petitioners filed a petition with the Court on September 22, 1989, at docket No. 23240-89. Respondent ultimately conceded the deficiency and additions to tax in issue in that case. A stipulated decision in petitioners' favor was entered by the Court on January 3, 1990. No notice of appeal was filed. Accordingly, the Court's decision in docket No. 23240-89 became final on April 4, 1990.
The prayer for relief in the petition filed at docket No. 23240-89 concluded with a general request for litigation costs under section 7430. (See Rule 34(b), which states in relevant part that "A claim for reasonable litigation costs shall not be included in the petition in a deficiency action.") Although a reply was not required under Rule 37, petitioners filed such a pleading, which concluded with a prayer that "all relief sought in the petition, including attorneys' fees and litigation costs, be granted." Petitioners never pursued their claim for litigation costs in accordance with Rules 230 through 233. Nor did they make any claim for administrative costs during the pendency of docket No. 23240-89, although such claims were authorized by legislation enacted in 1988. Accordingly, the decision entered on January 3, 1990, was silent regarding litigation and administrative costs.
On January 3, 1991, petitioners commenced the present action by filing a petition for administrative costs under section 7430(f)(2). Petitioners seek to recover administrative costs incurred in respect of respondent's income tax examination of their 1986 taxable year, the same year as the one in issue in the case at docket No. 23240-89. A part of the administrative costs claimed by petitioners relates to action allegedly taken by respondent after the decision in the case at docket No. 23240-89 had become final.
Discussion
As originally enacted, section 7430 only authorized the Court to award reasonable litigation costs. See sec. 292, Tax Equity and Fiscal Responsibility Act of 1982, Pub. L. 97-248, 96 Stat. 324, 572-574. See also Tax Reform Act of 1986, Pub. L. 99-514, sec. 1551, 100 Stat. 2085, 2752-2753. However, the scope of section 7430 was broadened by amendments made by section 6239 of subtitle J (the Omnibus Taxpayer Bill of Rights) of the Technical and Miscellaneous Revenue Act of 1988 (TAMRA), Pub. L. 100-647, 102 Stat. 3342, 3743-3746. Effective for proceedings commenced after November 10, 1988, the Court is authorized to award both reasonable litigation costs and reasonable administrative costs. TAMRA sec. 6239(d), 102 Stat. 3746.
The term "reasonable administrative costs" is defined by section 7430(c)(2) to include (1) administrative fees or similar charges imposed by the Internal Revenue Service, (2) reasonable expenses of expert witnesses, (3) reasonable costs of studies, analyses, engineering reports, tests, or projects that are necessary for the preparation of the taxpayer's case, and (4) reasonable fees (generally limited to a rate not in excess of $75 per hour) paid or incurred for the services of a qualified representative. See also sec. 7430(c)(3). Recoverable administrative costs include only costs incurred on or after the earlier of one of two dates, namely (1) the date of the receipt by the taxpayer of the notice of the decision of the Internal Revenue Service Office of Appeals or (2) the date of the notice of deficiency. Sec. 7430(c)(2).
As discussed above, TAMRA broadened the scope of section 7430 to provide for the recovery of administrative costs. If a taxpayer is not successful in obtaining relief from a proposed, determined, or threatened tax liability at the administrative level, and if the taxpayer incurs administrative costs, then the taxpayer may seek to recover such costs in this Court as part of a deficiency, liability, revocation, or partnership action. In such context, the recovery of administrative costs (as well as the recovery of litigation costs) is necessarily collateral to the action's primary objective, i.e., relief from the determined or threatened tax liability.
A taxpayer may succeed, however, in obtaining complete relief from a proposed, determined, or threatened tax liability at the administrative level. Such a taxpayer would be spared the costs of litigation associated with the prosecution of a deficiency (or liability, revocation, or partnership) action. Nevertheless, he or she may very well have incurred administrative costs. In order to provide a means of recovering such administrative costs, TAMRA created a new cause of action. This new remedy is an action for administrative costs under section 7430(f)(2).
Section 7430(f)(2) provides as follows:
SEC. 7430(f). Right of Appeal.—

(2) Administrative proceedings. — A decision granting or denying (in whole or in part) an award for reasonable administrative costs under subsection (a) by the Internal Revenue Service shall be subject to appeal to the Tax Court under rules similar to the rules under section 7463 (without regard to the amount in dispute).
Thus, under section 7430(f)(2), a taxpayer may appeal a decision of the Internal Revenue Service denying an award for reasonable administrative costs by commencing an independent action in this Court. In such an action, the recovery of administrative costs is not a collateral matter, as it is when recovery is sought in the context of an ongoing deficiency (or liability, revocation, or partnership) action. Rather, the pursuit of administrative costs is the sole object of the action under section 7430(f)(2).
The Parties' Contentions
Respondent contends that the Court lacks jurisdiction in this case because the doctrine of res judicata bars petitioners' claim. In this regard, respondent maintains that petitioners' failure to claim administrative costs in the prior proceeding precludes them from instituting an independent action under section 7430(f)(2). Petitioners, on the other hand, contend that a common-law doctrine such as res judicata cannot override a specific statutory remedy such as the one afforded them by section 7430(f)(2). In their view, the doctrine of res judicata is simply irrelevant.
Jurisdiction in Actions for Administrative Costs
We have previously held that in a deficiency case the doctrine of res judicata "operates not as a jurisdictional bar but by way of estoppel." Jefferson v. Commissioner, 50 T.C. 963, 966 (1968). There is no reason that this conclusion should not also apply in an action for administrative costs.
In a deficiency action, the Court's jurisdiction depends on two, and only two, prerequisites, namely (1) the issuance by the Commissioner of a notice of deficiency and (2) the (timely) filing of a petition for redetermination of the deficiency by the taxpayer. Secs. 6212 and 6213; Versteeg v. Commissioner, 91 T.C. 339, 340 (1988); Hubbard v. Commissioner, 89 T.C. 792, 799 n.9 (1987); Rule 13(a) and (c). As we construe section 7430(f)(2), the Court's jurisdiction in an action for administrative costs also depends on two, and only two, prerequisites, namely (1) a decision by the Commissioner denying (in whole or in part) an award for administrative costs under section 7430(a), and (2) the filing of a petition for administrative costs by the taxpayer. See Rule 270(c).
Our view of applicable jurisdictional prerequisites recognizes a parallel between actions for administrative costs and actions for redetermination of a deficiency. Thus, in an action for administrative costs, the Commissioner's decision denying an award for administrative costs is the jurisdictional analog of the notice of deficiency; similarly, the petition for administrative costs is the jurisdictional analog of the petition for redetermination.
We have also described the doctrine of res judicata as an affirmative defense. Jefferson v. Commissioner, 50 T.C. at 966; Miller v. Commissioner, 68 T.C. 767, 774 n.3 (1977). Indeed, Rule 39 expressly identifies res judicata as an affirmative defense. The rule provides as follows:
RULE 39. PLEADING SPECIAL MATTERS
A party shall set forth in the party's pleading any matter constituting an avoidance or affirmative defense, including res judicata, collateral estoppel, estoppel, waiver, duress, fraud, and the statute of limitations. A mere denial in a responsive pleading will not be sufficient to raise any such issue.
Rule 270(a), as relevant here, provides that the Court's "other Rules of Practice and Procedure," i.e., Rules other than Rules 270 through 274 but including Rule 39, are applicable to actions for administrative costs under section 7430(f)(2).
If an affirmative defense is not pleaded, it is deemed to be waived. Jefferson v. Commissioner, 50 T.C. at 966-967. This characteristic of an affirmative defense is antithetical to the principle that questions concerning the Court's jurisdiction can be raised at any time, even after the case is tried and briefed, and even by the Court sua sponte. Smith v. Commissioner, 96 T.C. 10, 13-14 (1991); Kahle v. Commissioner, 88 T.C. 1063 n.3 (1987).
In view of the foregoing, we reject respondent's contention that jurisdiction is lacking in this case because petitioners' claim for administrative costs is barred by the doctrine of res judicata.
Before proceeding further, we feel constrained to note that respondent's answer in this case raises another (but unrelated) jurisdictional issue. Although respondent has not pursued such issue in his motion to dismiss for lack of jurisdiction, we will nevertheless briefly address it.
As stated above, the Court's jurisdiction in an action for administrative costs depends in part on a decision by the Commissioner denying (in whole or in part) an award for administrative costs under section 7430(a). Petitioners allege in their petition that a letter dated October 5, 1990, from respondent's deputy regional counsel for tax litigation for the Western region constitutes such a decision. In his answer, respondent denies this allegation and alleges instead that such letter merely responded to petitioners' inquiry concerning the means by which a taxpayer should file a claim for administrative costs.
Petitioners' inquiry concerning the mechanics of filing a claim for administrative costs was undoubtedly prompted by the Commissioner's failure to advise the public regarding procedures applicable to the filing of such claims and the issuance of decisions under section 7430(f)(2). Cf. sec. 8465, Internal Revenue Manual (May 20, 1991). Although the October 5, 1990, letter informed petitioners that claims for administrative costs "should be addressed to the office that handled the matter administratively," the letter went on to advise petitioners that "this procedure would not apply" in their case because their claim should have been pursued in docket No. 23240-89 and was now barred.
Under the above circumstances, the October 5, 1990, letter is tantamount to a decision by the Commissioner denying an award for administrative costs and therefore satisfies the jurisdictional prerequisite.
Res Judicata as an Affirmative Defense in Actions for Administrative Costs
That the doctrine of res judicata does not affect the Court's jurisdiction does not mean that the doctrine is irrelevant to actions for administrative costs. For reasons to be discussed, we reject petitioners' contention that an action under section 7430(f)(2) must proceed on the merits without regard to res judicata.
Res judicata is a common-law doctrine that serves to promote judicial economy and the repose of disputes. The meaning and scope of the doctrine has been described by the Supreme Court as follows:
The general rule of res judicata applies to repetitious suits involving the same cause of action. It rests upon considerations of economy of judicial time and public policy favoring the establishment of certainty in legal relations. The rule provides that when a court of competent jurisdiction has entered a final judgment on the merits of a cause of action, the parties to the suit and their privies are thereafter bound "not only as to every matter which was offered and received to sustain or defeat the claim or demand, but as to any other admissible matter which might have been offered for that purpose." The judgment puts an end to the cause of action, which cannot again be brought into litigation between the parties upon any ground whatever, absent fraud or some other factor invalidating the judgment. [Commissioner v. Sunnen, 333 U.S. 591, 597 (1948); citations omitted.]
The essence of the doctrine of res judicata is that a cause of action judicially decided is finally decided as to both (1) matters that were actually litigated and decided and (2) matters that could have been litigated and decided in the proceeding. See Flora v. Commissioner, 47 T.C. 410, 413 (1967). See also United States v. International Building Co., 345 U.S. 502, 506 (1953) (res judicata applies when decision is entered pursuant to agreement of the parties). Cf. Montana v. United States, 440 U.S. 147 (1979), regarding the related doctrine of collateral estoppel.
As a predicate to the application of the doctrine of res judicata here, we find that (1) the decision entered in the case at docket No. 23240-89 was entered within the scope of this Court's acknowledged deficiency jurisdiction and that (2) the decision entered in that case on January 3, 1990, became final on April 4, 1990. Secs. 7481(a)(1) and 7483. The petition at docket No. 23240-89 was filed on September 22, 1989, a date well after the effective date of section 7430(f)(2). Accordingly, petitioners could have made a claim for administrative costs in that docket. Sec. 7430(a). Because of their failure to do so, res judicata bars petitioners from litigating in the present case administrative costs that could have been litigated in the previous case.
We are not persuaded by petitioners that the creation of a specific statutory remedy such as the one provided by section 7430(f)(2) does or should preclude the application of common-law doctrines such as res judicata. After all, res judicata is a well established and longstanding judicial doctrine. See, e.g., Cromwell v. County of Sac, 94 U.S. 351, 352 (1877). Nothing in either the language of section 7430(f)(2) or its legislative history suggests that Congress intended that actions for administrative costs should proceed without regard to the doctrine of res judicata. See H. Rept. 100-1104 (Conf.) (Vol. II) (1988), 1988-3 C.B. 473, 714-716. Cf. sec. 6212(c)(1) regarding the statutory exception to the doctrine of res judicata for fraud.
Moreover, the TAMRA amendments to section 7430 and the legislative history indicate that Congress enacted section 7430(f)(2) in order to provide a remedy for the recovery of administrative costs where one would not otherwise exist. H. Rept. 100-1104 (Conf.) (Vol. II) (1988), supra. Thus, for example, if a taxpayer succeeds in obtaining complete relief from a proposed income tax deficiency at the administrative level and no notice of deficiency is therefore sent, but the Internal Revenue Service denies a claim for administrative costs, the taxpayer would not be able to pursue the recovery of such costs in a deficiency action. In this instance, section 7430(f)(2) provides the only remedy. In contrast, if a taxpayer fails to obtain relief from a proposed income tax deficiency at the administrative level and incurs administrative costs, the taxpayer would be able to pursue the recovery of such costs (as well as litigation costs) in a deficiency action and would not, therefore, need an independent remedy.
Finally, the policy behind the doctrine of res judicata, as stated by the Supreme Court in Commissioner v. Sunnen, quoted above, applies where the taxpayer had the opportunity to claim administrative costs in the course of a prior deficiency, liability, revocation, or partnership action, but failed to do so. We perceive no countervailing policy that would justify creating an exception to the doctrine of res judicata for actions for administrative costs.
Conclusion
We hold that the doctrine of res judicata has no bearing on the Court's jurisdiction in an action for administrative costs. We also hold that the doctrine of res judicata bars an action for administrative costs under section 7430(f)(2) to the extent that the recovery of such costs could have been pursued in a prior deficiency, liability, revocation, or partnership case.
Our holdings in this case suggest that we should treat respondent's motion to dismiss for lack of jurisdiction as a motion for summary judgment. We have discretion to do so.
See Amesbury Apartments, Ltd. v. Commissioner, 95 T.C. 227, 237-238 (1990); Reddock v. Commissioner, 72 T.C. 21, 28 (1979). The record in this case, however, is not ripe for dispositive action. Some unspecified part of the administrative costs claimed by petitioners relates to assessment or collection action allegedly taken by respondent in respect of petitioners' 1986 taxable year after finality of decision in the case at docket No. 23240-89. The decision entered in that docket, however, reflected a full concession by respondent for 1986. Obviously, recovery of any costs incurred after the decision in the case at docket No. 23240-89 had become final could not have been pursued in that case. Moreover, there is an implicit issue, not addressed by the parties, to wit, whether such costs are even recoverable as administrative costs. See H. Rept. 100-1104 (Conf.) (Vol. II) (1988), 1988-3 C.B. at 716. Accordingly, we will deny respondent's motion to dismiss for lack of jurisdiction and take no other action at this time.
To give effect to the foregoing,
An order denying respondent's motion will be issued.