The former husband, Mark S. Weiss-man, seeks certiorari review of a September 20, 2012, emergency ex parte order. We grant the petition in part and quash the portion of the order providing that the children shall have no direct or indirect contact with the former husband for ninety days.
Background
As a result of the parties’ dissolution of marriage in 2005, the parties had equal timesharing with their three minor children.1 In 2011, the former wife filed a petition for modification of the final judgment, alleging that the former husband and his girlfriend were responsible for alienating the oldest daughter from the former wife.2 The former husband filed a counterpetition for modification of the final judgment, denying the former wife’s allegations. Dr. Deborah Day, a licensed psychologist, was appointed as guardian ad litem.
In July 2012, the former wife filed a motion to enjoin the former husband’s girlfriend from having contact with the children, based on a preliminary report and recommendation from Dr. Day. The trial court entered the temporary injunction enjoining the former husband from allowing his children to have contact with his girlfriend. The former husband moved to dissolve the injunction, and the former wife then filed two motions, alleging that the former husband was in contempt for failing to obey the terms of the injunction and asking the court to suspend the former husband’s unsupervised timesharing. The former wife asserted that the former husband had allowed the children to have contact with his girlfriend during a vacation. The former wife sought temporary sole parental responsibility to determine the best treatment for the oldest daughter. The former husband filed a motion to modify the injunction and sought supervised contact between the oldest daughter and his girlfriend.
On August 22, 2012, the trial court held a hearing on the pending motions filed by both parties. The former husband with*720drew his motion to modify the injunction based on a report by Dr. Kathryn Kuehnle that the former husband’s girlfriend may pose a risk of emotional harm to the children. The trial court found that the former husband violated the terms of the injunction, but the trial court declined to find him in contempt due to the serious consequences a contempt finding could have on the former husband’s medical career. The trial court found that it was in the best interests of the children to grant the former wife temporary sole decision making authority over the health care of the children, which included selecting an out-of-state residential treatment program to address the problems between the oldest child and the former wife and the impact those problems have on the younger children. The trial court found that the oldest child needs immediate, intensive psychiatric intervention. The trial court noted that she had threatened to run away, and the trial court expressed a concern that the child may pose a risk to herself. The trial court allowed the younger children to reside with the former wife and the oldest child to reside with the former husband until a treatment program could be selected. The trial court also reduced the former husband’s visitation with the youngest children to after school and evenings on Monday and Friday and all day on Sunday. The trial court entered a written order on September 5, 2012, in accordance with its oral findings and rulings.
On September 18, 2012, the former wife, through her counsel, filed an ex parte letter with the trial court, advising the trial court that Dr. Day and the former wife had decided on a treatment program in California. Included was a proposed order, the terms of which were purportedly consistent with the recommendations of the treatment program. The letter informed the trial court that the treatment program recommended that the order be entered ex parte “because of the substantial likelihood that [former husband] would tell and/or inform the [oldest child] that she will be leaving with [former wife] to attend the program, which would likely cause a disruption in the process.” The former wife also submitted a letter from Dr. Day, who indicated that she had conferred with the intake doctor at the treatment program. Dr. Day “concur[red] with [the intake doctor’s] plan of intervention and requested that] the plan be implemented.”
On September 20, 2012, the trial court entered the proposed ex parte order submitted by the former wife. The order identified the program and provided that it would run from September 22, 2012, to October 2, 2012. The order directed the wife and all three children to attend the program. The order provided that “[u]ntil further order of the [c]ourt, consistent with [the program’s] protocol, it is in [the children’s] best interests to immediately have no direct or indirect contact in any form whatsoever with the [fjormer [h]us-band; relatives, friends, and associates of the [fjormer [h]usband; and [his girlfriend].” The order further provided that it shall be in effect for no less than ninety days from the family’s return from the program. The order directed the former husband to bring the oldest child to the courthouse on September 21, 2012, so that the former wife could transport her to the program.
The former husband now seeks review of the September 20, 2012, order.3 The parties’ petition and counterpetition for modification of the final judgment remain pending in the trial court.
*721Discussion
In his petition for writ of certiorari, the former husband claims that the trial court violated his due process rights by entering the order prohibiting all contact with his children for ninety days without providing him notice or an opportunity to be heard. He contends that he was not given any notice that the trial court would alter the order entered only two weeks before on September 5, 2012, in a way that would -prevent him from having any contact with his children for a period of ninety days. The former husband argues that no emergency existed that would warrant modifying his visitation oh contact without notice or a hearing.
When a trial court modifies a parent’s visitation without notice and an opportunity to be heard, the parent may seek certiorari review on the basis that the court departed from the essential requirements of the law, resulting in harm that is irreparable on appeal. See A.W.P., Sr. v. Dep’t of Children & Family Servs., 10 So.3d 134, 135 (Fla. 2d DCA 2009); Aiello v. Aiello, 869 So.2d 22, 24 (Fla. 2d DCA 2004). “[U]nder extraordinary circumstances, a trial court may ... enter an order temporarily modifying custody of a child ... without affording prior notice to the opposing party.” Smith v. Crider, 932 So.2d 393, 398 (Fla. 2d DCA 2006). “[Hjowever, such an order requires an emergency situation, such as where a child is threatened with physical harm or is about to be improperly removed from the state.” Id.; Aiello, 869 So.2d at 23.
The trial court did not depart from the essential requirements of law in ordering the children to participate in the treatment program selected by Dr. Day and the former wife.4 The former husband had notice that these issues were being considered by the trial court at the August 22, 2012, hearing, and the former husband was provided an opportunity to be heard on these issues at the hearing.
However, the language in the September 20, 2012, order preventing the former husband from having any contact, direct or indirect, with his children for ninety days appears to have been the result of recommendations made by the treatment program in California. The former husband was never provided notice that he may be prevented from having any contact with his children for a period of at least ninety days and he was not provided an opportunity to be heard on this issue. At the hearing, the trial court fashioned a temporary schedule of visitation,5 but it is clear from the hearing transcript that the trial court did not contemplate preventing all contact with the children at that time or for a period of ninety days. Extraordinary circumstances justified immediately placing the oldest child in a treatment program, but there were no extraordinary circumstances presented which justified preventing visitation or contact for ninety days upon the family’s return from the program without first affording the former husband notice and an opportunity to be heard.
[W]here a trial court properly enters [an emergency ex parte] order, an opportunity to be heard should be provided to the opposing party as soon thereafter as possible. Failure to give notice to the opposing party prior to the entry of an *722order when no emergency exists, or failure to provide notice and an opportunity to be heard promptly after the entry of an order when an emergency is presented, deprives the opposing party of his or her right to procedural due process.
Smith, 932 So.2d at 398 (citations omitted) (citing Williams v. Williams, 845 So.2d 246, 248 (Fla. 2d DCA 2003); Loudermilk v. Loudermilk, 693 So.2d 666, 667-68 (Fla. 2d DCA 1997)). Once the urgent situation regarding the oldest child’s treatment was resolved, the trial court should have held a hearing to decide the issue of visitation and contact that would occur after the treatment program was concluded, giving the former husband notice and an opportunity to be heard on that issue. We grant the petition in part and quash the portion of the order that prevents the former husband from having contact with his children.
Petition denied in part; petition granted in part.
NORTHCUTT, J., and GALLEN, THOMAS M., Associate Senior Judge, Concur.. The parties have three daughters, born in 1996, 1998, and 2001.
. At this time, the oldest daughter was fifteen.
. It appears that the former husband complied with the order and that the former wife and the children attended the treatment program in California.
. This issue is likely moot because the treatment program was scheduled to end on October 2, 2012.
. At one point at the hearing, the trial court stated that the schedule would be temporary until they could "try this case," but later, the trial court stated that the schedule would be in place until the children come back from the treatment program. At the time of the hearing, the former wife and Dr. Day were considering a treatment program in Texas.