
448 So.2d 397 (1984)
Deranell TAYLOR
v.
STATE of Alabama.
Civ. 4155.
Court of Civil Appeals of Alabama.
April 4, 1984.
Joel Lee Williams, Troy, for appellant.
Mary Lee Stapp and James E. Long, Asst. Attys. Gen., for appellee.
*398 HOLMES, Judge.
This is an appeal from a termination of custody of two minor children.
The Juvenile Court of Pike County awarded custody of two minor children to the Department of Pensions and Security of Pike County. The mother through able counsel appeals.
The dispositive issue as presented by the mother is whether the juvenile court had jurisdiction in this matter. We hold that the juvenile court did have jurisdiction, and thus, this case is due to be affirmed.
The relevant facts are as follows:
On November 2, 1983, the Pike County Department of Pensions and Security filed a petition with the juvenile court alleging the dependency of the mother's two minor children. On November 3, 1983, the father filed for divorce in the Circuit Court of Pike County. On November 8, 1983, the circuit court awarded custody of the children to the mother pursuant to an agreement between the parents that was incorporated into the divorce decree.
The petition alleging dependency did not indicate that the immediate well-being and safety of the children was involved. The juvenile court also determined that an emergency situation did not exist. On November 28, 1983, the juvenile court awarded custody to the Department.
Although the general law is that once the circuit court has obtained jurisdiction over the custody of the child, that jurisdiction continues during the infancy of the child, Wise v. Watson, 286 Ala. 22, 236 So.2d 681 (1970), there are exceptions. One exception is where there exists an emergency as to the immediate welfare of the child. Roberson v. McAliley, 387 So.2d 840 (Ala.Civ.App.1980). However, that exception does not apply here.
There is a rule of law applicable in this instance that "where two courts have equal and concurrent jurisdiction, the court that first commences the exercise of its jurisdiction in a matter has the preference and is not to be obstructed in the legitimate exercise of its powers by a court of coordinate jurisdiction." Rush v. Simpson, 373 So.2d 1105, 1108 (Ala.Civ.App. 1979). The juvenile court has equitable powers in the area of child custody which are equal to the equitable powers of the circuit court in custody matters in divorce proceedings. Ala.Code § 12-15-2(f) (1975). Therefore, in this instance and under these facts, since the juvenile court assumed jurisdiction first on November 2, 1983, it had jurisdiction to determine dependency and award custody. We particularly note that the circuit court's custody determination was based upon an agreement between the mother and father, and furthermore, there appears to be no question of the children's dependency.
This case is due to be and is affirmed.
AFFIRMED.
WRIGHT, P.J., and BRADLEY, J., concur.
