
498 S.E.2d 695 (1998)
VIRGINIA PAROLE BOARD, et al.
v.
Trance W. WILKINS.
Record No. 970628.
Supreme Court of Virginia.
February 27, 1998.
Mary E. Shea, Assistant Attorney General (Richard Cullen, Attorney General; Mark R. Davis, Senior Assistant Attorney General, on briefs), for appellant.
(Kenneth R. Yoffy; Cope, Olson & Yoffy, on brief), Newport News, for appellee. Appellee submitting on brief.
Present: CARRICO, C.J., COMPTON, LACY, HASSELL, KEENAN, and KOONTZ, JJ., and STEPHENSON, Senior Justice.
STEPHENSON, Senior Justice.
The dispositive issue in this appeal is whether, in the circumstances of this case, the trial court had jurisdiction to grant a writ of habeas corpus.
Since April 1980, Trance W. Wilkins has been detained by the Virginia Department of Corrections pursuant to multiple convictions, including attempted murder, robbery, and use of a firearm in the commission of a felony. He is serving a total sentence of 143 years.
On April 5, 1996, Wilkins filed the present pro se petition for a writ of habeas corpus, challenging, in claims (a) through (z), the 1995 decision of the Virginia Parole Board (the Board) to deny him discretionary parole and defer for two years his next parole review. The trial court appointed counsel to represent Wilkins.
The Board filed a motion to dismiss Wilkins' petition, and, following a hearing, the trial court, by an order entered January 2, 1997, granted the motion to dismiss and dismissed with prejudice claims (a) through (z). Nevertheless, the court, sua sponte, granted a writ of habeas corpus, finding that Wilkins "was denied due process when [the Board] deferred his 1996 annual parole review without providing [Wilkins] with a reason for the deferral." Accordingly, the court ordered that Wilkins "be reviewed for parole *696 in 1996 and that, if [the Board] exercises its discretion to defer [Wilkins'] annual review in the future, [the Board] provide him with the reason(s) for the deferral."
The Board contends, inter alia, that Wilkins' petition should be dismissed because the trial court had no habeas corpus jurisdiction to grant the relief it ordered. We agree.
Under the common law, the purpose and scope of the writ of habeas corpus is to test the legality of a prisoner's detention. The writ
is available only where the release of the prisoner from his immediate detention will follow as a result of an order in his favor. It is not available to secure a judicial determination of any question which, even if determined in the prisoner's favor, could not affect the lawfulness of his immediate custody and detention.[*]
McDorman v. Smyth, 187 Va. 522, 525, 47 S.E.2d 441, 443 (1948); accord McClenny v. Murray, 246 Va. 132, 134, 431 S.E.2d 330, 331 (1993); Blowe v. Peyton, 208 Va. 68, 73, 155 S.E.2d 351, 355-56 (1967); Peyton v. Williams, 206 Va. 595, 601, 145 S.E.2d 147, 151 (1965); Smyth v. Midgett, 199 Va. 727, 730, 101 S.E.2d 575, 578 (1958); Smyth v. Holland, 199 Va. 92, 96-97, 97 S.E.2d 745, 748-49 (1957), cert. denied, 357 U.S. 944, 78 S.Ct. 1394, 2 L.Ed.2d 1556 (1958).
The trial court's determination in the present case does not affect the lawfulness of Wilkins' immediate custody and detention, and Wilkins' release from his immediate detention will not follow as a result of the trial court's order. Consequently, the trial court did not have habeas corpus jurisdiction to grant the relief it ordered.
Accordingly, the judgment of the trial court will be reversed, and the petition for a writ of habeas corpus will be dismissed.
Reversed and dismissed.
NOTES
[*]  The scope of the common-law writ of habeas corpus has been expanded by Code § 8.01-654(B)(3), which provides that a petition for the writ "may allege detention without lawful authority through challenge to a conviction, although the sentence imposed for such conviction is suspended or is to be served subsequently to the sentence currently being served by [the] petitioner."
