
782 So.2d 237 (2000)
Ex parte Roderick B. DAVIDSON.
(Re Roderick B. Davidson v. Kimberly Ann Lewis f/k/a Kimberly Ann Davidson.)
1991008.
Supreme Court of Alabama.
October 13, 2000.
*238 G. John Dezenberg, Jr., Huntsville, for petitioner.
Barbara C. Miller, Huntsville, for respondent.
BROWN, Justice.
Roderick B. Davidson, who had been the defendant in a domestic-relations action in the Madison Circuit Court, petitions for a writ of mandamus directing Judge Loyd H. Little to set aside his orders entered in the action after November 12, 1999, and to refrain from exercising further jurisdiction over the modification petition filed in this case regarding custody of the parties' two minor children. Davidson (hereinafter referred to as "the father") contends that the postjudgment motion of Kimberly Ann Lewis ("the mother") was denied by operation of law, pursuant to Rule 59.1, Ala. R.Civ.P., on February 10, 2000; therefore, he claims, the trial judge had no authority to enter the orders it entered on February 18 and 29, 2000. Those orders (1) required him and one of the minor children to be tested and evaluated to determine the father's parenting skills and abilities, and (2) purported to reopen the modification proceedings to review alleged conflicts in the testimony of one of the minor children. We grant the petition.
Roderick Davidson and Kimberly Lewis were divorced on November 22, 1991. By the divorce judgment, Davidson was awarded custody of parties' the two minor children, a daughter and a son.[1] On October *239 2, 1992, the mother filed a petition to modify the divorce judgment, seeking a change of custody from the father to the mother. On August 18, 1993, the trial court denied the petition.
On July 7, 1998, the mother filed a second modification petition, again seeking a change of custody. The gist of the mother's petition was that a change of custody was warranted because, she alleged, the father was depriving the children of necessary medical care. The father counterpetitioned, claiming the mother was subjecting the children to unnecessary medical procedures and asking that the mother be ordered to pay child support, pursuant to the Child Support Guidelines set out in Rule 32, Ala.R.Jud.Admin.
On July 15, 1998, the mother moved an order requiring the father to take a parenting-skills-assessment test. The court initially granted that motion, but on September 11, 1998, it set aside its order granting the motion and denied it. On October 12, 1999, the trial court entered a final judgment on the mother's modification petition and on the father's counterpetition. The court found that the minor children were being "properly and adequately cared for by their father." The court's order also set a visitation schedule and awarded the father child support, but it denied all other claims by the mother and the father.
On November 12, 1999, the mother filed a motion to alter, amend, or vacate the October 12, 1999, judgment, pursuant to Rule 59(e), Ala.R.Civ.P.[2] On December 22, 1999, the trial court entered an order stating that it "finds that a substantial conflict exists in the evidence ... in part of the testimony offered by the minor child, [the son]." The trial court noted that the mother had filed several motions before the trial on her modification petition, seeking testing and evaluation of the minor children and the parents, and the trial court found that "upon further review of those motions filed by the [mother], the court is satisfied that it would have been proper to order such testing and evaluation." The trial court then ordered that the father and the minor son be tested and evaluated, providing also that "nothing contained in this order, at this time, modifies or changes any provision of the October 12, 1999, judgment," and that "The custody and visitation arrangements shall remain the same, as well as payment of child support and other financial obligations, pending further order of this court."
On January 12, 2000, the trial court entered an amended order on the mother's postjudgment motion. That amended order provided for evaluation and testing of the father and the son by a counselor other than the one named in the December 22, 1999, order. The January 12, 2000, order also directed that the newly named counselor notify the court when his testing and evaluations were completed. The amended order again stated that "nothing contained in this order, at this time, modifies or changes any provision of the October 12, 1999, judgment." However, the trial court stated that "by entry of this order, the court is reopening the case for the taking of additional testimony from Dr. Preston at the appropriate time, as well as other testimony that the court may request or allow from other witnesses at a subsequent hearing."
*240 February 10, 2000, was the 90th day after November 12, 1999the date the mother filed her motion to alter, amend, or vacate the judgment. On February 14, the father filed a motion asking the court to immediately terminate the proceedings, arguing that the mother's postjudgment motion had been denied by operation of law, pursuant to Rule 59.1, Ala.R.Civ.P., on February 10, 2000, and, thus, that the court was without jurisdiction to proceed further. On that same day, the father filed a petition for writ of mandamus in the Court of Civil Appeals, requesting that that court direct the trial court to set aside its orders entered after November 12, 1999. On February 18, 2000, the court entered an order on the father's motion, stating in effect that the court was awaiting a ruling of the Court of Civil Appeals on the father's mandamus petition. The court further stated that "this court assumed, perhaps erroneously, as contended by the [father], that this court retained jurisdiction of this child custody case."
On February 22, 2000, the Court of Civil Appeals, without an opinion, denied the father's petition for a writ of mandamus. Ex parte Davidson (No. 2990497) ___ So.2d ___ (Ala.Civ.App.2000) (table). On February 28, 2000, the trial court ordered the father and the minor child to comply with its order of December 22, 1999, which required that they schedule appointments for evaluation and testing. On March 1, 2000, the father, acting pursuant to Rule 21, Ala.R.App.P., petitioned this Court for a writ of mandamus directing the circuit court to set aside its orders entered after November 12, 1999. We grant the petition.
The writ of mandamus is a drastic and extraordinary remedy, to be issued only when there is (1) a clear legal right in the petitioner to the order sought; (2) an imperative duty upon the respondent to perform, accompanied by a refusal to do so; (3) the lack of another adequate remedy; and (4) properly invoked jurisdiction of the court. Ex parte Horton, 711 So.2d 979, 983 (Ala.1998) (citing Ex parte United Serv. Stations, Inc., 628 So.2d 501 (Ala. 1993)); Ex parte Alfab, Inc., 586 So.2d 889, 891 (Ala.1991) (citing Martin v. Loeb & Co., 349 So.2d 9 (Ala.1977)). Moreover, "`[t]he right sought to be enforced by mandamus must be clear and certain with no reasonable basis for controversy about the right to relief,'" and "`[t]he writ will not issue where the right in question is doubtful.'" Ex parte Bozeman, 420 So.2d 89, 91 (Ala.1982) (quoting Ex parte Dorsey Trailers, Inc., 397 So.2d 98, 102 (Ala. 1981)). "[T]he question of subject matter jurisdiction is reviewable by a petition for a writ of mandamus." Ex parte Johnson, 715 So.2d 783, 785 (Ala.1998) (citing Ex parte Alfa Mut. Gen. Ins. Co., 684 So.2d 1281 (Ala.1996)).
The filing of a petition to modify a domestic-relations judgment is, for purposes of applying the rules of procedure, treated as the filing of a separate action. Thus, the 90-day provision of Rule 59.1, Ala.R.Civ.P., applies to a motion to alter, amend, or vacate a final order entered on a petition to modify the child-custody provisions of a divorce judgment. See, e.g., Snow v. Snow, 531 So.2d 921 (Ala.Civ.App. 1988). Rule 59.1, Ala.R.Civ.P., provides:
"No post-judgment motion filed pursuant to Rules 50, 52, 55, or 59 shall remain pending in the trial court for more than ninety (90) days, unless with the express consent of all the parties, which consent shall appear of record, or unless extended by the appellate court to which an appeal of the judgment would lie, and such time may be further extended for good cause shown. A failure by the trial court to dispose of any pending post-judgment motion within *241 the time permitted hereunder, or any extension thereof, shall constitute a denial of such motion as of the date of the expiration of the period."
"There are only two methods listed in Rule 59.1 for extending the 90-day period: (1) the express consent of all parties to an extension of the 90 day period, [and] (2) the grant of an extension of time by an appellate court." Farmer v. Jackson, 553 So.2d 550, 552 (Ala.1989). Here, just as in Farmer v. Jackson, neither method was used to extend the period for ruling on the postjudgment motion.
If a trial judge allows a postjudgment motion to remain pending and not ruled upon for 90 days, then the motion is denied by operation of law at the end of the 90th day and the trial judge then loses jurisdiction to rule on the motion. See, e.g., Ex parte Hornsby, 663 So.2d 966, 967 (Ala.1995); see also Ex parte Caterpillar, Inc., 708 So.2d 142, 143 (Ala.1997).
The facts of this case closely resemble those in Farmer v. Jackson, supra. There, the trial court, in response to a postjudgment motion, and within 90 days after it had entered the judgment, entered an order by which it indicated it would "reconsider" its judgment. However, it did not, within the 90 days allowed by Rule 59.1, rule on the merits of the postjudgment motion and either grant it or deny it. This Court stated:
"A trial court, by issuing an order agreeing to `reconsider' its earlier decision, does not extend the 90-day period, nor will a trial court's decision to rehear the matter be considered a disposition of the post-judgment motion within the meaning of Rule 59.1 The merits of the post-judgment motion must be ruled on within the 90 day period in order to avoid the denial mandated by Rule 59.1."
553 So.2d at 552; see also Borders v. Borders, 702 So.2d 147, 148 (Ala.Civ.App. 1997).
In this present case, the trial court purported to reopen the case, in response to the mother's Rule 59(e) motion, but it did not, within 90 days, rule on the merits of that motion. Indeed, each of the trial court's orders entered after November 12, 1999, specifically stated that it did not change "any provision of the October 12, 1999, judgment."
We must conclude that the mother's postjudgment motion was denied by operation of law on February 10, 2000, and that the trial court was without jurisdiction to enter any further order in this case after that date. All orders entered by the court pursuant to the mother's motion to alter, amend, or vacate the October 12, 1999, judgment are void. The circuit court is directed to set aside those orders and to enter no further orders in this case unless one of the parties files a new modification petition, in effect commencing a new action.
PETITION GRANTED; WRIT ISSUED.
HOOPER, C.J., and HOUSTON, SEE, and ENGLAND, JJ., concur.
NOTES
[1]  When the modification petition now at issue was filed, the daughter was age 15 and the son was age 9.
[2]  A Rule 59(e) motion ordinarily must be filed within 30 days from the date of the judgment. The 30th day in this case was November 11 the Veterans Day holiday. Thus, the mother's motion filed on the 31st day was timely. See Rule 6(a), Ala.R.Civ.P.
