
449 S.E.2d 55 (1994)
Marilyn Gibson KELLEY
v.
David Allen KELLEY.
Record No. 931522.
Supreme Court of Virginia.
September 16, 1994.
Jonathan S. Kurtin, Roanoke (Harvey S. Lutins, Lutins & Shapiro, on briefs), for appellant.
Charles B. Phillips, Salem (Phillips, Doherty & Swanson, on brief), for appellee.
Com. of Virginia, Dept. of Social Services, Div. of Child Support Enforcement (James S. Gilmore, III, Atty. Gen., William H. Hurd, Deputy Atty. Gen., Betsy S. Elliott, Richmond, Alice G. Burlinson, Christiansburg, Steven P. Roadcap, Fort Defiance, on brief), for amicus curiae appellant.
Present: All the Justices.
STEPHENSON, Justice.
In this appeal, we decide (1) whether a provision of a property settlement agreement, which was ratified, affirmed, and incorporated by reference into a divorce decree, is void and, if so, (2) whether the decree may be attacked and vacated after it has become final.
On April 29, 1985, David Allen Kelley (Husband) and Marilyn Gibson Kelley (Wife) executed a property settlement agreement (the Agreement). On September 23, 1985, the trial court (the Circuit Court of the City of Roanoke) entered a divorce decree which ratified, affirmed, and incorporated by reference the Agreement.
The Agreement contained the following provision:
The parties hereto agree, in consideration of Husband relinquishing all of his equity in the jointly-owned marital home, that Husband shall never be responsible for payment of child support. The [Wife] covenants and agrees never to file a petition in any Court requesting that [Husband] be placed under a child support Order because [Wife] has accepted all of [Husband's] equity in lieu of requesting child support.
In the event [Wife] should ever petition any Court of competent jurisdiction for support and maintenance of [the children], and should a Court grant any such child support award, the said [Wife] hereby covenants and agrees to pay directly to [Husband], any amount of support that he is *56 directed to pay to any party. In other words, [Wife] is agreeing to hold harmless [Husband] from the payment of any amount of child support, regardless of the circumstances under which he is paying same.
Pursuant to the Agreement, the Husband conveyed his equity in the marital home, valued at $40,000, to the Wife. For approximately six years thereafter, the Husband paid nothing toward the support of his children; the Wife, alone, supported them.
In late 1990, the Husband petitioned the trial court for definite periods of visitation with his children, and the Wife petitioned the court to require the Husband to pay child support. The Husband countered with a motion requesting the court to order the Wife to reimburse him for any amount of child support he was required to pay.
The trial court ordered the Husband to pay support and denied the Husband's motion, ruling that the indemnification and reimbursement provision of the Agreement was null and void. The Husband appealed from the trial court's judgment to the Court of Appeals. The Husband did not challenge the ordered child support, but contended that the trial court erred in holding that the indemnification and reimbursement provision of the Agreement was void and unenforceable.
The Court of Appeals, upon rehearing en banc, reversed the trial court's judgment, concluding that the trial court lacked jurisdiction to alter the terms of the Agreement or decree. The Court of Appeals reasoned that, pursuant to Rule 1:1, the September 23, 1985 decree became final, and not subject to modification, after 21 days from the date the decree was entered. Kelley v. Kelley, 17 Va.App. 93, 435 S.E.2d 421 (1993).[*] We awarded the Wife an appeal from the judgment of the Court of Appeals, concluding that the case involves a matter of significant precedential value. Code § 17-116.07(B).
Both parents owe a duty of support to their minor children. Code § 20-61; Featherstone v. Brooks, 220 Va. 443, 448, 258 S.E.2d 513, 516 (1979). A divorce court retains continuing jurisdiction to change or modify its decree relating to the maintenance and support of minor children. Code § 20-108; Featherstone, 220 Va. at 446, 258 S.E.2d at 515. Consequently, parents cannot contract away their children's rights to support nor can a court be precluded by agreement from exercising its power to decree child support. Id.; Carter v. Carter, 215 Va. 475, 481, 211 S.E.2d 253, 258 (1975); Scott v. Scott, 12 Va.App. 1245, 1247, 408 S.E.2d 579, 581 (1991).
In the present case, the parties agreed that the "Husband shall never be responsible for payment of child support." The Wife agreed "never to file a petition in any court" requesting support for the children. The Wife covenanted that, if a court ordered the Husband to pay child support, she would reimburse the Husband for all sums paid by him. She further agreed to hold the Husband harmless for any amount of child support he was required to pay.
Clearly, the parties contracted away the Husband's legal duty to support his children and, in effect, placed upon the Wife the sole duty of support. Additionally, the Wife's ability to contribute to the support of the children was adversely affected. Thus, the children's rights to receive support from both parents were substantially abridged, and the court's power to decree support was diminished. We hold, therefore, that the challenged provision of the Agreement is null and void because it is violative of clearly established law.
Next, we consider whether the trial court had jurisdiction to declare the provision null and void. The Court of Appeals ruled that the trial court lacked jurisdiction. Citing Rule 1:1, the Court of Appeals held that "after the expiration of twenty-one days immediately following the entry of the 1985 divorce decree, except to modify the amount of child support, the trial court lacked jurisdiction to alter the terms of the [Agreement] or the decree." Kelley, 17 Va.App. at 94, 435 S.E.2d at 422.
*57 The Court of Appeals relied largely upon Rook v. Rook, 233 Va. 92, 353 S.E.2d 756 (1987). In Rook, a married couple executed a property settlement agreement prior to the filing of a suit for divorce. Thereafter, the agreement was ratified, affirmed, and incorporated by reference into a divorce decree. In a subsequent contempt proceeding for failure to comply with the terms of the decree, the husband contended that the agreement was void as against public policy, asserting that its purpose was to facilitate a divorce. Id. at 93, 353 S.E.2d at 757. We held, in Rook, that the challenge to the agreement's validity should have been made before the divorce decree was entered or within 21 days thereafter. Id. at 95, 353 S.E.2d at 758.
The present case is distinguishable from Rook because it involves the rights of children to support and maintenance. These rights, as previously noted, cannot be impinged by contract, and any contract purporting to do so is facially illegal and void.
In the present case, the subject provision of the Agreement was ratified, affirmed, and incorporated by reference into the divorce decree and, therefore, "shall be deemed for all purposes to be a term of the decree." Code § 20-109.1. Consequently, that portion of the decree that relates to the void provision is, itself, void.
It is firmly established that a void judgment may be attacked and vacated in any court at any time, directly or collaterally. Rook, 233 Va. at 95, 353 S.E.2d at 758; Slaughter v. Commonwealth, 222 Va. 787, 793, 284 S.E.2d 824, 827 (1981); Broyhill v. Dawson, 168 Va. 321, 328, 191 S.E. 779, 782 (1937). Therefore, the trial court had jurisdiction to declare the provision void and unenforceable.
Accordingly, we will reverse the judgment of the Court of Appeals, affirm the trial court's ruling, and enter final judgment for the Wife.
Reversed and final judgment.
NOTES
[*]  Rule 1:1 provides, in pertinent part, as follows:

All final judgments, orders, and decrees ... shall remain under the control of the trial court and subject to be modified, vacated, or suspended for twenty-one days after the date of entry, and no longer.
