
571 So.2d 662 (1990)
Pauline Smith MOBLEY, Administratrix of the Succession of Paul J. Smith, Deceased, Plaintiff-Appellant,
v.
Henry HARREL, Defendant-Appellee.
No. 21575-CA.
Court of Appeal of Louisiana, Second Circuit.
June 20, 1990.
On Rehearing December 5, 1990.
Hamilton & Carroll by Orlando N. Hamilton, Jr., Oak Grove, for plaintiff-appellant.
C. Calvin Adams, Jr., Tallulah, for defendant-appellee.
Before HALL, C.J., and SEXTON and LINDSAY, JJ.
HALL, Chief Judge.
The administratrix of the Succession of Paul J. Smith, Pauline Smith Mobley, *663 brought an action on behalf of the estate to recover on two promissory notes issued to Paul J. Smith by defendant, Henry Harrel. Before trial, plaintiff admitted that one of the notes had been paid, but maintained the action on the second promissory note. After trial, the district court found that the second note was given for an illegal cause, funds due the deceased from an illegal gambling operation, and dismissed the plaintiff's suit on the note. Plaintiff appeals that judgment.

FACTS AND PROCEDURAL HISTORY
The deceased, Paul J. Smith, and the defendant entered an agreement on January 10, 1980, whereby the deceased sold P.J.'s Last Chance Lounge to the defendant. As consideration for the sale, defendant gave a promissory note of $102,170.40, which was secured by a mortgage. On that same date, defendant gave an additional unsecured note for $100,000. Defendant wrote the following in a letter also dated January 10, 1980:
"This will confirm our verbal agreement that in addition to the consideration recited in the deed from you to me passed this date, I will pay to you an additional sum of $100,000.00 during the next five years. This $100,000.00 is evidenced by a non-interest bearing note which is enclosed herewith ..."
The administratrix of the Succession of Paul J. Smith brought an action for recovery on the $102,170.40 note in June of 1987. Defendant answered the suit alleging payment and reconvened seeking to have the note marked paid and the mortgage securing the note canceled. The administratrix then filed a supplemental petition seeking recovery on the unsecured $100,000 note, and the defendant again alleged payment as a defense.
Before trial, the parties were able to agree to a stipulation. They agreed that Harrel had made sufficient payments to liquidate the $102,170.40 note. With respect to the $100,000 note, Ms. Mobley contended that $12,305.69 was paid on the note and that the remainder was due, while Mr. Harrel contended that he had paid $79,234.19, with $20,765.81 still due.
During trial, Mr. Harrel admitted that he had given the $100,000 note to Mr. Smith. He testified that the note was given as evidence of sums owed Mr. Smith from a gambling operation conducted on the premises of P.J.'s Last Chance Lounge. When asked whether P.J.'s was worth the recited consideration in the deed, Mr. Harrel stated:
"Well, we had the business figured at a hundred thousand dollars less the inventory when I purchased the property and the part he had at the time. The other side note was between he and I on other things that we had done, and I was to pay it out of that, which was poker games and blackjack, and things of that nature."
(R. p. 169, emphasis added).
He also stated that the $102,170.40 note was given to purchase the property, P.J.'s Lounge, but that the other note was given to evidence sums owed the deceased from the gambling operation. After he had already testified as indicated, plaintiff's attorney objected "to any testimony that tends to vary or contradict the terms of the written instrument." The trial judge stated that she sustained the objection.
After the trial had concluded, the trial judge rendered judgment in favor of the defendant, stating that the note had been given for an illegal cause and was unenforceable in court.
Plaintiff appeals with three assignments of error: (1) that the trial court erred in failing to consider the parties' joint pre-trial stipulation; (2) that the trial court erred in considering excluded evidence; and (3) that the trial court erred in finding that the note was given for an illegal cause.

GAMBLING EVIDENCE
The plaintiff's argument concerning gambling evidence is twofold. First, she asserts that the defendant failed to plead illegal cause as a defense, and that any evidence tending to show illegal cause was objected to and sustained by the court. It is her contention that the trial judge erred *664 in considering excluded evidence. Secondly, she asserts that even if the evidence could be considered, it does not show that the note was given for an illegal cause.
At trial, plaintiff's counsel objected only after the gambling testimony was in the record. His objection was that the testimony tended to vary or contradict the terms of a written instrument.
LSA-C.C. Art. 1848 provides that testimonial or other evidence may not be admitted to negate or vary the contents of an authentic act or act under private signature. Nevertheless, in the interest of justice, that evidence may be admitted to prove such circumstances as a vice of consent, or a simulation, or to prove that the written act was modified by a subsequent and valid oral agreement. Parole proof is admissible to show that a written act, though clothed with the appearance of proper formalities and conferring apparently a just right, is nonetheless in contravention of a prohibitory law in the interest of public morals, making it a nullity. Succession of Fletcher v. Decoudreau, 11 La. Ann. 59 (1856). Also, negotiable paper is governed by the rules peculiar to itself and the want, failure, or illegality of consideration for the note may be established by parole evidence, with any exclusion of such parole evidence being error. LSA-R.S. 10:3-306, 3-408; Belknap Hardware & Mfg. Co. v. Hearn, 179 La. 909, 155 So. 396 (1934); National American Bank of New Orleans v. Davis, 239 So.2d 493 (La.App. 4th Cir.1970).
Even though the defense of illegal cause is in the nature of an affirmative defense, plaintiff's counsel did not object to the evidence as an expansion of the pleadings. The stated objection was not valid since the parol evidence was admissible to show the true consideration for the note and to show illegal cause. Thus, the evidence was properly considered as an unobjected to expansion of the pleadings, and the trial court did not err in considering the testimony in regard to why the $100,000 note was given.
In any event, the objection was not entered until the evidence was already of record. Plaintiff's counsel did not move to strike the testimony from the record. The trial court stated in reasons for judgment that the testimony did not tend to vary the note, but only explained why the note was given. Therefore, we cannot say that the trial court erred in considering this evidence.
As for the conclusion that the note was given for an illegal cause, we must agree. Mr. Harrel candidly admitted that the $100,000 note was given to evidence proceeds owed the deceased from a gambling operation. This testimony was not contradicted in any way.
LSA-C.C. Arts. 1966 and 1968 provide that an obligation cannot exist without a lawful cause, and that an obligation is unlawful when the enforcement of the obligation would produce a result which is unlawful or against public policy. Since the note was given as evidence of sums due the deceased from an unlawful gambling operation, the cause of the obligation in this case is unlawful. See LSA-R.S. 14:90 and Lillis v. Perez, 144 So.2d 455 (La.App. 4th Cir.1962). Therefore, the obligation is an absolute nullity as the trial court correctly concluded.

STIPULATION
By this argument, the plaintiff asserts that the parties stipulated that the sole issue for trial was the amount due on the $100,000 promissory note. She argues that the trial court erred in considering issues beyond the scope of the stipulation. What seems at issue by implication in this assignment of error is whether the defendant's admission of owing $20,765.81 prohibits the court from voiding the note for an unlawful cause.
Generally, a stipulation has the effect of a judicial admission which binds the parties and the court when not in derogation of law. R.J. D'Hemecourt Petroleum v. McNamara, 444 So.2d 600 (La. 1983). To the extent the agreement affects only the rights of the litigants it must be applied as the law of the case. However, agreements between the parties cannot affect the powers, duties and prerogatives of *665 the court in relation to other litigants, the general public and state. Wickliffe v. Cooper & Sperrier, 161 La. 417, 108 So. 791 (1926); Hair v. City of Baton Rouge, 297 So.2d 451 (La.App. 1st Cir.1974), writ denied 300 So.2d 183.
A contract is absolutely null when it violates a rule of public order, as when the object of a contract is illicit or immoral. A contract that is absolutely null may not be confirmed. Absolute nullities may be declared by the court on its own initiative. LSA-C.C. Art. 2030. If a contract contravenes an imperative statutory rule, it is absolutely null and not subject to ratification. E.L. Burns Company, Inc. v. Cashio, 302 So.2d 297 (La.1974).
The stipulation in question does not provide that the sole issue for trial is the amount of the payment. As stated earlier, the defendant could not admit or confirm the obligation because it is an absolute nullity. Once the testimony showed that the consideration for the note was based on an illegal gambling operation, the court was free to recognize on its own initiative that the cause of the obligation was illegal, rendering the obligation an absolute nullity.
Finding no merit to the plaintiff's assignments of error, for the foregoing reasons, the judgment of the trial court dismissing the plaintiff's demand is affirmed at plaintiff-appellant's cost.
AFFIRMED.

ON REHEARING
Before MARVIN, SEXTON, LINDSAY, HIGHTOWER, JJ., and PRICE, Judge Pro Tem.
PER CURIAM.
In the original opinion herein, we affirmed the trial court's reliance on testimony that the open note at issue was given for an illegal cause.
In application for rehearing, appellant complains of that ruling, pointing out that the trial court considered that evidence even though her counsel's objection thereto had been sustained by the trial court.
Appellant argues that, because the trial court sustained her objection, her counsel concluded that the testimony which had been objected to was removed from consideration. Thus she contends that her counsel did not cross-examine Mr. Harrel on the issue or seek a continuance based on surprise at the unpleaded defense for this reason. She argues she was thus "ambushed" by the reliance of the trial court on "excluded evidence" in reaching its opinion.
We reiterate our view expressed in the original opinion that appellant did not object to the evidence of an illegal cause on the basis that it was an expansion of the pleadings. Counsel's objection was that the evidence tended to vary the terms of the agreement. As we pointed out in the original opinion, the evidence of an illegal cause is admissible under such circumstances.
However, we are sympathetic to appellant's point that since the objection was sustained by the trial court, appellant could assume that the testimony objected to had been removed from the court's consideration. We can therefore understand that appellant did not cross-examine the defendant-appellee in this respect and that appellant did not attempt to present additional available evidence on the subject.
We have therefore concluded that the original opinion was in error in affirming the trial court. We now reverse the judgment of the trial court and remand the case for consideration of any evidence which plaintiff or defendant may have on the question of illegal cause and for a ruling on plaintiff's demands in light of that evidence and the evidence previously presented.
We now assess costs of this appeal to defendant-appellee.
REVERSED AND REMANDED.
