
210 Va. 446 (1970)
CRITERION INSURANCE COMPANY
v.
GRANGE MUTUAL CASUALTY COMPANY, ET AL.
Record No. 7056.
Supreme Court of Virginia.
January 19, 1970.
Present, All the Justices.
Insurance company, seeking to avoid uninsured motorist liability to its assured, may maintain a declaratory judgment proceeding against the alleged tort feasor's liability carrier to determine which company is liable and should defend tort action.  Declaratory judgment act is remedial and is to be liberally construed.
Error to a judgment of the Court of Law and Chancery of the City of Norfolk. Hon. Walter A. Page, judge presiding.
Robert M. Furniss, Jr. (Furniss and Davis,    on brief), for plaintiff in error.
James L. Miller (Williams, Worrell, Kelly & Worthington,    on brief), for defendants in error.
I'ANSON
I'ANSON, J., delivered the opinion of the court.
Criterion Insurance Company (Criterion) filed in the court below a motion for a declaratory judgment against Grange Mutual Casualty Company (Grange), Fred W. McDaniel, Melvin L. Langfitt, Clyde Salmons, William H. Buck, Richard J. Attebury, Robert S. Campbell, Thomas C. Burleson and Henry O. Mangrum to determine the liability of the two insurance companies for damages for injuries sustained by Salmons, Buck, Attebury, Campbell, Burleson and Mangrum in an automobile accident.
The question presented on this appeal is whether Criterion, the uninsured motorist carrier, may maintain a declaratory judgment proceeding against Grange, the tort feasor's liability carrier, to declare the obligations of Grange under its contract of insurance.  *447 
Criterion alleged in its motion that defendant Grange issued an automobile liability policy on a 1959 Chevrolet owned by Fred W. McDaniel; that on January 5, 1964, the insured automobile, while it was being driven by Melvin L. Langfitt with McDaniel's permission, collided with an automobile owned by Henry O. Mangrum and operated by Thomas C. Burleson; that as a result of the collision, actions for damages were filed against Langfitt and McDaniel by all the passengers in the Mangrum car, its driver and its owner; that Grange had wrongfully denied coverage to Langfitt and McDaniel; that at the time of the accident Criterion had in effect a policy of insurance with an uninsured motorist endorsement on the automobile owned by Mangrum; that if Grange was not liable under its policy, Langfitt and McDaniel were uninsured motorists and Criterion would be obligated to defend Langfitt and McDaniel and to pay the damages for which they might be liable; and that a genuine dispute existed as to which insurer is obligated under the terms of their respective policies.
In its grounds of defense Grange admitted that it had in effect a liability policy on the McDaniel automobile, but it disclaimed liability under the terms of its policy because at the time of the accident the insured automobile was being operated without McDaniel's permission, and Langfitt was not a member of McDaniel's family.
Soon after Criterion filed its motion it requested the court to permit it to amend its motion in order that it might seek damages from Grange for amounts it had expended in settlement of certain claims arising out of the accident.  This motion was never passed on by the trial court.  However, on January 3, 1968, the court permitted Criterion to amend its original motion to allege that Burleson had obtained a judgment against Langfitt in the amount of $1500, which judgment had not been paid.
After our decision in    General Accident     Aetna,    208 Va. 467, 158 S.E.2d 750 (January 15, 1968), the trial court was of opinion that it controlled the present case.  Hence the court, in a letter opinion, dismissed the proceedings on the grounds that there was no actual controversy or issue between Criterion and Grange "as the liability is contractual and arises under the Uninsured Motorist law after the liability of the uninsured motorist has been established, and the Supreme Court of Appeals having held that the uninsured motorist carrier has no recourse under the law against the liability carrier, the *448 opinion of the court would be merely advisory."  We do not agree that our decision in    General Accident    is controlling here.
In    General Accident    the action was brought by the insurer of the injured motorist against the insurer of the tort feasor to recover the amount it paid the injured motorist pursuant to an uninsured motorist endorsement.  We held that Code | 38.1-381(f), as amended, [1] does not authorize a subrogation action by the uninsured motorist's liability insurer against the insurer of the person causing injury to recover payments made under the uninsured motorist endorsement.  208 Va. at 474, 475, 158 S.E.2d at 755.
General Accident    differs from the present case in that Criterion's motion for declaratory judgment requests the court to declare whether it or Grange is obligated to defend the actions pending against Langfitt and McDaniel. This proceeding is not a subrogation action by Criterion against Grange, the tort feasor's liability carrier, to recover the amounts it paid in settlement to the injured parties under the uninsured motorist endorsement, as was the case in General Accident.     It is true that Criterion did seek to amend its motion to recover from Grange the amounts it paid in settlement of some of the claims arising out of the accident, but the trial court did not act on the motion.  It would not have been proper for the trial court to have granted the motion to amend because under our decision in    General Accident    Criterion could not maintain an action against Grange to recover the amounts it had paid some of the injured parties under its uninsured motorist endorsement.  The court properly permitted Criterion to amend the motion to allege that the judgment obtained by Burleson against Langfitt had not been paid.
We also said in    General Accident    that it was not necessary for us to decide whether General Accident should have proceeded by a motion for declaratory judgment or by one of several other available courses of action, as suggested by counsel for Aetna, to determine which Company was liable and should defend.  208 Va. at 469, 158 S.E.2d at 752.
Hence    General Accident    does not stand for the principle that an uninsured motorist carrier cannot maintain a declaratory judgment proceeding against the tort feasor's liability carrier to determine which company was liable and should defend.
The purpose of the Declaratory Judgment Act (Chap. 25, Title 8, *449 Code of 1950, 1957 Repl. Vol.) "is to afford relief from the uncertainty and insecurity attendant upon controversies over legal rights, without requiring one of the parties interested so to invade the rights asserted by the other as to entitle him to maintain an ordinary action therefor."  The Act is remedial and is to be liberally construed and administered.  Code | 8-585, as amended.  But before an action may be maintained under the Act there must be a justiciable controversy, for the rendering of advisory opinions is not a part of the function of the judiciary in Virginia.  Code | 58-578, as amended; 11 Mich. Jur., Judgments and Decrees, | 222, p. 280, and the cases there cited.
When a justiciable controversy exists between two insurance companies as to their obligations under the terms of their respective policies, a declaratory judgment proceeding may be maintained by one of the companies against the other. Safeco Insurance Co.     Dairyland Mutual Ins. Co.,    74 Wash.2d 672, 446 P.2d 568 (1968).  See also,    Globe Indemnity Co.     St. Paul Fire & Marine Ins. Co.,    369 F.2d 102, 104 (3rd Cir. 1966);    Industrial Underwriters Ins. Co.     P. & A Construction Co.,    382 F.2d 313, 315 (10th Cir. 1967); 22 Am.Jur.2d, Declaratory Judgments, | 47, p. 902.
In the instant case Criterion has no obligation under the uninsured motorist endorsement of its insurance contract unless Langfitt and McDaniel are uninsured.  Criterion alleged that Grange had wrongfully denied coverage, thereby making Langfitt and McDaniel uninsured, and that a judgment was obtained against Langfitt which has not been paid.  Thus a justiciable controversy exists between Criterion and Grange, and the declaratory judgment proceeding instituted by Criterion, with all parties in interest before the court, is proper to determine the obligations of Grange, if any, under its policy.
For the reasons stated, the judgment of dismissal of Criterion's motion for a declaratory judgment is set aside, and the case is reinstated and remanded for further proceedings.
Reversed and remanded.
NOTES
[1]    Section was further amended, 1968 Acts of Assembly, ch. 721, pp. 1264, 1266, after our decision in    General Accident.
