
547 P.2d 1302 (1976)
MID-STATE HOMES, INC., and Jim Walter Corporation, Appellants,
v.
David J. JOHNSTON and Edith Johnston, Appellees.
No. 46585.
Supreme Court of Oklahoma.
February 24, 1976.
Rehearing Denied April 13, 1976.
Lawrence A.G. Johnson, Farmer, Woolsey, Flippo & Bailey, Tulsa, for appellants.
Stamper & Otis, Antlers, for appellees.
*1303 SIMMS, Justice:
Plaintiff, Mid-State Homes, Inc., (MidState) sued defendants David Johnston and Edith Johnston (David's former wife) to recover on a promissory note and to foreclose the real estate mortgage securing the note.
Defendants had entered into a building contract with the Jim Walter Corporation on May 14, 1965, for the construction of a "shell" house on their property in Atoka County. As security for payment the defendants executed a promissory note and mortgage to the Jim Walter Corporation for the principal sum of $8,092.00 payable at the rate of $56.20 per month. Mid-State alleged that it was a bona fide purchaser of the note and mortgage for value without notice and that the note and mortgage were assigned to Mid-State on May 27, 1965. Plaintiffs petition was filed on March 21, 1970, and alleged that the sum of $5,367.20 was due and owing on the note and mortgage and further that plaintiff was entitled to an attorney fee in the amount of $809.28.
Prior to the filing of this action David Johnston had been divorced from Edith Johnston and the real property involved in this cause had been awarded to him. He later married Beverly Johnston and since the property concerned here was their homestead, Beverly Johnston was made a party-defendant.
David Johnston filed an answer and cross-petition wherein he alleged that the Jim Walter Corporation and Mid-State were in effect one and the same organization and that Mid-State was not a bona fide purchaser of the instrument sued on; that the house had been defectively and improperly built; and that the amount that he would pay on the note had been misrepresented. Johnston asserted that by reason of the fraud and deceit practiced upon him the plaintiff and Jim Walter had been unjustly enriched in the amount of $978.60, the amount in excess of the actual value of the house which he had paid, he sought as actual damages, that by reason of the fraud and deceit he was entitled to $10,000.00 punitive damages and further, he prayed for attorney fees in the amount of $809.28.
On defendant's motion, the Jim Walter Corporation was joined as an additional party defendant.
Plaintiff and Jim Walter filed a demurrer and answer to defendant's cross-petition and Mid-State filed a reply alleging that it was a bona fide purchaser for value of one note and mortgage without notice. Plaintiff then waived its right to an in personam judgment. The issues were thus joined and the cause was tried to the court as all parties waived a jury trial.
Judgment was rendered in all respects in favor of defendants. Plaintiff was denied *1304 any judgment against defendants. Defendant David Johnston was awarded actual damages of $978.60, punitive damages in the amount of $10,000.00, and attorney fees of $978.60.
Jim Walter Corporation and Mid-State filed a joint appeal. The Court of Appeals, Div. I, affirmed the judgment of the trial court in part and modified in part, reducing the attorneys fees to the amount of $809.28, to conform with the sum prayed for in defendants cross-petition. Mid-State Homes, Inc. et al. v. Johnston, Okl.App., 45 OBAJ 1434, June 4, 1974.
Seeking certiorari, Mid-State and Jim Walter Corporation urge several grounds in support of their contention that the trial court erred in rendering judgment against them and that the Court of Appeals erred in affirming same. Among other propositions they urge that the defendant's action in fraud was barred by the statute of limitations, that this defense was preserved and that the trial court therefore erred in allowing testimony in support of the cross-petition. We find this argument persuasive and we grant certiorari. As this issue is dispositive of the cause, we do not find it necessary to address the remaining grounds urged for reversal and we so limit the scope of this opinion.
The Johnstons' "shell" house was built in 1965. From the following examples of David Johnston's testimony it is clear that the defects in the construction upon which he based his action fraud, were known to him at the time the house was built.
"MR. STAMPER: I hand you what has been identified as defendant's Exhibit 1; what is that?
A. One of the windows in the front room of the house.
Q. Does it show the condition of the house at the time the house was finished?
A. Yes.
* * * * * *
"MR. JOHNSON: Court please, I object to it; it does not represent the condition of the house built in 1965.
MR. STAMPER: He says it did.
MR. JOHNSON: That's the same way it was when the house was built.
* * * * * *
"MR. STAMPER: I hand you defendant's Exhibit 3, and ask you did that condition exist at the time the house was supposedly completed?
A. Yes, sir.
* * * * * *
"Q. Does the condition that exists in that picture exist at the time the house was supposedly completed? The roof sagged just like it was there?
A. Yes, sir, it sags more every year.
* * * * * *
"MR. STAMPER: I hand you Exhibit 8; what portion of the house does that show?
A. It is the outside as you go into the front door into the living room.
Q. Did that condition exist at the time the house was supposedly completed?
A. Yes, it gets worse every year; it just sags right on down.
* * * * * *
"A. Well, it just keeps sagging down there; this is where you go into the living room.
MR. JOHNSON: What keeps sagging?
MR. DAVID JOHNSTON: The porch; the picture there will show.
* * * * * *
"A. Going out of the back of the house, the back door, the rain has blown in over the door and all around the door and discolored the sheet rock.
Q. Was it completed that way?
"A. When it started raining, it started doing it.

*1305 Q. Initially when the house was built, did it leak originally around the door?
A. Yes, sir.
* * * * * *
"A. Well, when the house was completed as far as they was supposed to complete, they was supposed to put the window seals in; they was not put in; it taken six months to get them put in or longer than that.
Q. How did you finally get them put in?
A. Well, this fellow that, I can't recall his name; the one that wrote the contract; I believe he is the one that finally got them done, but they built the house in something like 24 hours.
Q. How many people were working on it?
A. I believe there was just two; they worked all night long one night.
* * * * * *
"Q. Tell the Court how it was built?
A. The house was not braced properly when it was built.
* * * * * *
"A. I made them tear one of the bathroom walls out; the 2x4's they put in was warped all to pieces, and you can tear a wall out now and you will find warped 2x4's in it.
Q. All right, now, was it true?
A. No, sir.
Q. All right, what did this cause? Did the doors open properly?
A. No.
* * * * * *
"Q. What kind of siding is on your house?
A. Pressed paper.
Q. Did you understand the house would be built out of paper?
A. No, sir, I did not understand that.
* * * * * *
"MR. STAMPER: About when was this? Was it when the house was being built when you objected to the paper being used?
A. When it was being built."
Under 12 O.S. 1971, § 95(3), the limitation period for bringing an action in fraud is two years. The statute further provides that the cause of action for relief based upon fraud shall not be deemed to have accrued until the discovery of the fraud. From the evidence presented at trial we are of the opinion that Mr. Johnston's cause of action for fraud accrued in 1965, as he had actual knowledge at that time of the fraudulent and deceitful practices being used in the construction of his house.
The Court of Appeals accepted Johnston's contention that 12 O.S. 1971, § 273 authorized his prayer for actual and punitive damages against Mid-State and Jim Walter, in spite of the limitation period. (Section 273 was amended in 1974, but that amendment is not relevant to this matter.) Section 273 provides:
"The counterclaim ... must be one existing in favor of a defendant and against a plaintiff, between whom a several judgment might be had in the action, and arising out of the contract or transaction set forth in the petition as the foundation of the plaintiff's claim or connected with the subject of the action. The right to relief concerning the subject of the action ... must be a right to relief necessarily or properly involved in the action for a complete determination thereof, or settlement of the question involved therein. Provided, that either party can plead and prove a setoff or counterclaim of the proper nature, in defense of the liability sought to be enforced by the other party, and it shall not be necessary that such setoff shall exist as between all parties plaintiff and defendant in each suit, but any party may enforce his setoff or deny counterclaim against the liability sought to be enforced *1306 against him. Such setoff or counterclaim shall not be barred by the statutes of limitations until the claim of the plaintiff is so barred."
We do not agree that this statute enabled Johnston to maintain an action for fraud past the two year limitation imposed by 12 O.S. 1971, § 95(3).
It is well settled in Oklahoma that while the statute of limitations will not bar a fraud from being asserted as a defense to the enforcement of a transaction asserted as fraudulent, the statute will run and bar affirmative relief sought on the ground of fraud when the cause of action accrued more than two years previously.
In State v. Austin, 182 Okl. 524, 78 P.2d 797 (1938), plaintiff brought action for recovery on a promissory note and to foreclose the mortgage securing the note. Defendant pleaded fraud as a defense and plaintiff contended that the defense of fraud was barred by the statute of limitations. The Court, quoting Dixon v. Hawkins, 178 Okl. 250, 62 P.2d 251 (1936), held:
"Statutes providing that, in an action for relief on the ground of fraud, limitation shall run from the time the fraud is discovered, apply only as against a party who seeks affirmative relief on the ground of fraud committed by his opponent; they do not apply so as to raise a bar against a party who is seeking merely to defend his rights on the ground that a contract or transaction sought to be enforced by his opponent is fraudulent. Likewise a statute providing that actions for relief against frauds must be commenced within a certain time after the cause of action accrues does not apply where the fraud is set up merely by way of defense and not as a ground for affirmative relief."
Johnston's claim was not presented as a defense to prevent Mid-State and Jim Walter Corporation from reaping benefits in a transaction allegedly tainted by their fraud. He sought affirmative relief, actual and punitive damages, past the limitation period of two years.
A succinct explanation of the reasoning behind this rule is found at 51 Am.Jur.2d, Limitation of Actions, § 76, wherein the author states:
"The ultimate purpose of a limitation law is to bar actions rather than to suppress or deny matters of defense. Hence, as a general rule, limitation statutes are not applicable to defenses, but apply only where affirmative relief is sought. The use of a cause of action as a shield or defense is not precluded, even though the statutory period has run against its use for affirmative relief at the time of the filing of action in which it is used. In other words, as long as the courts will hear the plaintiff's case, time will not bar the defense which might be urged thereto and which grew out of the transaction action connected with the plaintiff's claim; nor as a general rule, is the plea of limitations available as a defense to matter set up by a plaintiff in avoidance of a plea made by the defendant."
"The general rule set out above has been applied in a great variety of cases: for example, in actions for the possession of property and in cases where the statute of limitations was pleaded as a defense of fraud."
While, for the foregoing reasons, David Johnston was not entitled to recover damages, he nevertheless remained the prevailing party in the mortgage foreclosure action and under 42 O.S. 1971, § 176, he was entitled to recover his attorney fees.
We therefore vacate the opinion of the Court of Appeals.
Judgment of the trial court denying Appellants' prayer for foreclosure is Affirmed; Judgment of the trial court awarding Appellee actual and punitive damages is Reversed and Remanded with directions to enter judgment in favor of Appellant on Appellee's cross-petition; judgment of the trial court in favor of Appellees for Attorney Fees is modified to the sum of $809.29, *1307 the amount prayed for in the cross-petition.
WILLIAMS, C.J., HODGES, V.C.J., and DAVISON, IRWIN, LAVENDER, BARNES and DOOLIN, JJ., concur.
