
506 P.2d 1253 (1972)
Lavena E. SAUNDERS, Plaintiff-Appellant,
v.
Neil BANKSTON et al., Defendants-Appellees.
No. 71-422.
Colorado Court of Appeals, Div. II.
December 19, 1972.
Rehearing Denied January 30, 1973.
*1255 Al H. Haas, Durango, for plaintiff-appellant.
George R. Armstrong, Cortez, for defendants-appellees Neil Bankston and Alta Bankston.
Selected for Official Publication.
DWYER, Judge.
Plaintiff-appellant, Lavena E. Saunders, brought this action to set aside a certificate of redemption issued by defendant treasurer of Dolores County to defendants-appellees, Neil Bankston and Alta Bankston. The district court, on defendant's motion, dismissed plaintiff's complaint and entered judgment for defendants. The plaintiff has appealed. We reverse.
This is the second of two actions filed as a result of the following series of transactions.
On December 5, 1966, Saunders purchased a track of land located in Dolores County at a tax sale under 1965 Perm. Supp., C.R.S.1963, 137-11-1 et seq., and received a certificate of sale. Saunders subsequently paid the taxes for 1966 and 1967, and these payments were recorded on the certificate.
On April 25, 1969, the Bankstons recorded a quitclaim deed which purported to convey to them the same tract of land. On the same day, the Bankstons paid to the treasurer the amount necessary to redeem the property and received a certificate of redemption.
Saunders refused to accept the funds paid for the redemption of the property and refused to surrender her certificate of purchase. On December 9, 1969, Saunders applied for the issuance of a treasurer's deed, and statutory notice of such application was published by the treasurer.
On March 11, 1970, the Bankstons brought an action against the treasurer to enjoin the issuance of the treasurer's deed. Saunders was not joined as a party to the action. The treasurer, appearing by the district attorney of the county, confessed judgment, and, on March 17, 1970, the court permanently enjoined the treasurer from issuing a treasurer's deed to Saunders.
On October 19, 1970, more than seven months after the entry of the permanent restraining order, Saunders filed a motion to intervene in the action and tendered a proposed answer, counterclaim, and cross-claim. The motion to intervene was dened December 17, 1970. Saunders did not appeal from the order denying her motion to intervene. On April 15, 1971, Saunders instituted the present action.
The questions on appeal are: (1) Does the complaint state a claim upon which relief can be granted; and, (2) if the complaint states a claim, is it barred by the doctrine of res judicata?

Sufficiency of Complaint
In her complaint, Saunders alleges that she purchased the land in question at a tax sale; that she paid the taxes subsequently assessed; and that she has complied with all statutory requirements for the issuance of a treasurer's deed. Saunders further alleges that the grantor in the deed under which the Bankstons claim title had no interest in the property; that the deed conveyed no interest in the property to the Bankstons; and that the Bankstons had acquired no interest, legal or equitable, in the real estate and had no right to redeem the property. Saunders demanded that the certificate of redemption be set aside and that the treasurer be compelled to issue a tax deed.
In determining the sufficiency of a complaint, which is attacked by motion to dismiss, the material allegations of the complaint must be taken as admitted. Cisneros *1256 v. Cisneros, 163 Colo. 245, 430 P.2d 86; Cook v. City and County of Denver, 128 Colo. 578, 265 P.2d 700. The allegation that the Bankstons are strangers to the title and have no statutory right to redeem must be accepted as true. If this allegation is accepted as true, then Saunders, as the holder of a certificate of purchase at a tax sale, has stated an actionable claim against the Bankstons and the treasurer upon which she is entitled to relief.
1965 Perm.Supp., C.R.S.1963, 137-12-3(1), provides:
"Real property sold for taxes may be redeemed by the owner thereof, his agent, assignee, or attorney, or by any person having a legal or equitable claim therein. . . ."
The right of redemption is statutory and can be exercised only as the statute prescribes. One having no interest in the property cannot redeem. Hartman v. Reid, 17 Colo.App. 407, 68 P. 787.
An attempted redemption by a person having no interest in the property is ineffectual and may be set aside by the holder of a valid certificate of purchase obtained at a tax sale. In County Treasurer v. First National Bank, 87 Ill.App.2d 133, 230 N.E.2d 571, the court set aside an attempted redemption by a stranger to the title and ordered the treasurer to issue a tax deed to the purchaser at the tax sale. In the cases of Boyle v. Culp, 159 Colo. 423, 412 P.2d 543, and Bean v. Westwood, 101 Colo. 288, 73 P.2d 386, the court considered the validity of redemptions which were challenged by the holders of certificates of purchase at tax sales. In both cases, the court held that the redemption was made by a party having a statutory right to redeem and upheld the validity of the redemption. In both cases, the court recognized that an attempted redemption by one having no statutory right to redeem is ineffectual and cannot defeat the rights of the holder of the certificate of purchase.
The complaint filed by Saunders states a claim upon which relief can be granted.

Defense of Res Judicata
Saunders contends on appeal that the trial court improperly considered the defense of res judicata in granting the motion to dismiss.
Res judicata is an affirmative defense. C.R.C.P. 8(c). To sustain the defense, facts in support of it must be affirmatively shown either by evidence adduced at the trial or by way of uncontroverted facts properly presented in a motion for summary judgment. Ruth v. Department of Highways, 153 Colo. 226, 385 P.2d 410. In the present case, the plea is based upon the denial of the motion to intervene in the first case. The first case was decided in the same court where the second case was filed, and the records of the first case were before the court for consideration. The court properly treated the motion to dismiss as one for summary judgment and considered the defense of res judicata on its merits. See C.R.C.P. 12(b).
The record in the first case discloses that a final judgment enjoining the treasurer from issuing the treasurer's deed was entered on March 17, 1970. On October 19, 1970, more than seven months after the judgment became final, Saunders filed her motion to intervene. She sought to set aside the judgment previously entered in the case and also sought to assert claims against the Bankstons and the treasurer.
An existing or pending suit is a prerequisite to intervention. Thus, the motion to intervene was not timely, and the court properly denied it on that ground. The defense of res judicata is based upon the court's denial of the motion to intervene and not upon the judgment which had previously been entered. The judgment which terminated the action between the Bankstons and the treasurer is clearly not binding on Saunders because she was not a party to the litigation.
The claims which Saunders sought to assert by intervention in the first case are the same claims she asserts in the present action. However, the denial of the *1257 motion to intervene in the first case cannot operate as a bar to the present action unless the dismissal was an adjudication on the merits of the claims which Saunders sought to assert by intervention. A judgment based on any preliminary, subsidiary, or technical grounds is not on the merits. Smith v. Cowell, 41 Colo. 178, 92 P. 20. A judgment which is not on the merits of a case is not a bar to a subsequent action on the same claims. Dash v. Rubey, 144 Colo. 481, 357 P.2d 81.
Finality had attached to the judgment in the first case, and, whatever the merits of Saunders' claim, the court could not have permitted her to intervene. The court had no authority to consider the merits of the claims which Saunders sought to assert, and the court's denial of the intervention is not an adjudication on the merits of those claims. Accordingly, the claims which plaintiff asserts in the present action are not barred by the prior judgment.
The judgment is reversed and the cause remanded for further proceedings not inconsistant with this opinion.
SILVERSTEIN, C. J., and ENOCH, J., concur.
