Present:   All the Justices

RODNEY W. DORR
                                            OPINION BY
v.   Record No. 112131                JUSTICE DONALD W. LEMONS
                                           November 1, 2012
HAROLD CLARKE, DIRECTOR

            FROM THE CIRCUIT COURT OF FREDERICK COUNTY
                    John E. Wetsel, Jr., Judge

      In this appeal, we consider whether the Circuit Court of

Frederick County ("circuit court") erred when it held that

Rodney Wade Dorr ("Dorr") was not entitled to credit toward his

Virginia sentence for the period he was detained in a Virginia

jail awaiting trial.     At that time, he was a West Virginia

prisoner receiving credit toward his West Virginia sentence.

We also consider whether the circuit court erred when it

recharacterized Dorr's pleading, without providing him notice

and an opportunity to be heard.

                  I. Facts and Proceedings Below

      On February 26, 2009, Dorr was convicted of "one Felony

Count of Entry of a Dwelling House without Breaking by virtue

of his Plea of Guilty" in the Circuit Court of Berkeley County

in West Virginia (the "West Virginia court").    The West

Virginia court sentenced Dorr to "a term of not less tha[n] one

(1) year and no more than ten (10) years in the Penitentiary

House of th[at] State" and ordered his "[s]entence shall run
. . . current with any sentence imposed in the Commonwealth of

Virginia after February 26, 2009."

     Dorr was serving his West Virginia prison sentence when he

was transferred from West Virginia to Virginia on August 20,

2009, pursuant to the Interstate Agreement on Detainers, Code

§§ 53.1-210 through -215, to stand trial on criminal offenses

in Frederick County, Virginia.    Dorr was housed in the

Northwestern Regional Adult Detention Center (the "Detention

Center") in Frederick County while awaiting trial.    On January

5, 2010, Dorr was found guilty in the Circuit Court of

Frederick County of three felony grand larceny offenses, one

felony offense of eluding, and one misdemeanor offense of

driving on a suspended license.

     On April 22, 2010, Dorr appeared before the circuit court

for a sentencing hearing on those five offenses.    The circuit

court imposed sentences, pursuant to a plea agreement, as

follows: (1) a total of five years' imprisonment on the three

grand larceny charges; (2) ninety days' imprisonment on the

eluding charge; and (3) thirty days' imprisonment on the charge

of driving on a suspended license.    The circuit court suspended

four years of Dorr's total sentence of five years and one

hundred and twenty days.   The sentencing order stated: "The

defendant shall be given credit for time spent in confinement




                                  2
while awaiting trial, pursuant to Virginia Code Section 53.1-

187." 1

      On April 29, 2010, Dorr was transferred back to West

Virginia to serve the remainder of his sentence in that state.

The Virginia Department of Corrections ("VDOC") received a

document from the Administrator of the Detention Center titled

"Credit For Time Spent in Jail," which contained the amount of

time Dorr was sentenced for each of his Virginia convictions.

The "Credit For Time Spent in Jail" document also contained a

section titled "Jail Credit Information," which showed that

Dorr was to receive credit toward his Virginia sentences for

the time he spent in the Detention Center from August 20, 2009

until April 29, 2010, when he was transferred back to West

Virginia.

      After Dorr finished serving his West Virginia sentence, he

was transferred back to Virginia to serve his sentence on the

five offenses for which he was convicted in the Commonwealth.

VDOC provided Dorr with a "legal update" sheet shortly after

his arrival, which indicated that he had not received credit

for the time spent incarcerated from August 20, 2009 until

April 29, 2010.

      1
       Code § 53.1-187 provides, in relevant part, that "[a]ny
person who is sentenced to a term of confinement in a
correctional facility shall have deducted from any such term
all time actually spent by the person . . . in a state or local
correctional facility awaiting trial . . . ."

                                3
     On July 1, 2011, Dorr, proceeding pro se, filed a motion

for a writ of mandamus (the "petition") in the circuit court

against Harold Clarke ("Clarke"), the Director of VDOC, asking

the court to order VDOC "to comply with [the circuit court's]

order . . . giving [Dorr] full credit for time spent

incarcerated on the current charges he is now serving."

Specifically, Dorr claimed that he should receive credit for

his time in the Detention Center from August 20, 2009 to April

29, 2010.   The circuit court ordered VDOC to file a response to

Dorr's petition.

     In response, Clarke moved to dismiss Dorr's petition,

recharacterizing his "motion of mandamus" 2 as a petition for

writ of habeas corpus because Dorr requested relief in the form

of a shorter period of incarceration.   Clarke argued that the

time Dorr alleged should be credited toward his sentence was

properly applied toward his out-of-state sentence because, at

that time, he was still a West Virginia state prisoner serving

time on his West Virginia sentence.   Clarke also argued that

Dorr "is not entitled to receive credit for time served on

charges in one jurisdiction on his sentence from different

charges in a different jurisdiction unless" the Virginia court

ordered that, pursuant to Code § 19.2-308, the sentences be


     2
       Although Dorr labeled his pleading "motion of mandamus,"
this opinion will refer to it as a "motion for mandamus."

                                4
served concurrently.   Although Dorr alleged in his petition

that "[t]he West Virginia court imposed [his] sentence to run

'current' with any sentence imposed in the Commonwealth of

Virginia after February 26, 2009," Clarke argued that Virginia

is not bound by the West Virginia order.

     Dorr filed a response to Clarke's motion to dismiss,

requesting that the circuit court deny Clarke's motion.    Dorr

responded that he had filed a motion for mandamus asking the

circuit court to order VDOC to give him credit for time served

because the sentencing order provided that Dorr "shall be given

credit for time spent in confinement while awaiting trial,

pursuant to Virginia Code Section 53.1-187."

     In its September 13, 2011 order, the circuit court

concluded that Dorr's motion for writ of mandamus was in fact a

petition for a writ of habeas corpus and that Dorr "was on

detainer from West Virginia [from August 20, 2009 to April 29,

2010] and continued to serve his West Virginia sentence during

that time."   The circuit court held that: (1) Dorr was "not

entitled to receive credit for time served on charges in one

[sic] another state on his later sentence from different

charges in Virginia"; (2) Dorr "has been afforded all credit

for time served for which he is entitled"; and (3) Dorr's "time

has been accurately computed in accordance with Virginia




                                5
statutes and VDOC time computation practices."   Consequently,

the circuit court dismissed Dorr's petition.

     Dorr timely filed his petition for appeal, and we granted

Dorr's appeal on the following assignments of error:

     1. The circuit court judge erred when he allowed the
        respondent to recharacterize the pleading to the court,
        without first giving the petitioner ample notice, or the
        opportunity to withdraw or amend the pleading, nor
        informing him of the consequences.

     2. The circuit court judge erred in dismissing the motion
        of mandamus, and not ordering that the respondent, Va.
        D.O.C., was to abide by the April 22, 2010 court order
        stating that the defendant is to be credited for all
        time spent incarcerated prior to conviction and
        sentencing.

                           II. Analysis

                      A. Standard of Review

     The issue whether the circuit court erred in

recharacterizing Dorr's motion for a writ of mandamus as a

petition for a writ of habeas corpus is a question of law and,

therefore, we review the record de novo on appeal.     Alcoy v.

Valley Nursing Homes, Inc., 272 Va. 37, 41, 630 S.E.2d 301, 303

(2006).   Regardless whether Dorr's petition is characterized as

a mandamus petition or a habeas petition, we review the circuit

court's decision to deny his petition de novo.   See Moreau v.

Fuller, 276 Va. 127, 133, 661 S.E.2d 841, 845 (2008); Green v.

Young, 264 Va. 604, 608-09, 571 S.E.2d 135, 138 (2002).    "[T]he

determination whether mandamus lies as an extraordinary remedy



                                6
[is a] question[] of law subject to de novo review upon

appeal."   Moreau, 276 Va. at 133, 661 S.E.2d at 845.    Moreover,

"whether a prisoner is entitled to habeas relief is a mixed

question of law and fact.   Consequently, a circuit court's

conclusions of law are not binding on this Court but are

subject to review to ascertain whether the circuit court

correctly applied the law to the facts."    Green, 264 Va. at

608-09, 571 S.E.2d at 138 (citations omitted).

                    B. Credit for Time Served

     Dorr asserts that the circuit court erred in dismissing

the motion for mandamus, and not ordering the respondent to

comply with the April 22, 2010 court order stating that the

defendant is to be credited for all time spent incarcerated

prior to conviction and sentencing.    The Interstate Agreement

on Detainers "is a congressionally sanctioned interstate

compact within the Compact Clause" of the United States

Constitution.   Carchman v. Nash, 473 U.S. 716, 719 (1985).

Dorr's transfer to Virginia from West Virginia was made

pursuant to the Interstate Agreement on Detainers. 3    See Code

§ 53.1-210; W. Va. Code § 62-14-1.    Article V(a) of the

Interstate Agreement on Detainers provides that a state where a

prisoner is currently incarcerated (the sending state) may send


     3
       Both Virginia and West Virginia are party states.    Code
§ 53.1-210; W. Va. Code § 62-14-1.

                                7
that prisoner to another state where the prisoner has

outstanding criminal charges (the receiving state) to stand

trial.    Code § 53.1-210, art. V(a); W. Va. Code § 62-14-1, art.

V(a).    Article V(d) of the Interstate Agreement on Detainers

describes this process as "temporary custody," and provides

that:

        The temporary custody referred to in this
        agreement shall be only for the purpose of
        permitting prosecution on the charge or charges
        contained in one or more untried indictments,
        informations or complaints which form the basis
        of the detainer or detainers or for prosecution
        on any other charge or charges arising out of
        the same transaction.

Code § 53.1-210, art. V(d); W. Va. Code § 62-14-1,

art. V(d).

        Moreover, Article V(f) of the Interstate Agreement on

Detainers provides that "[d]uring the . . . temporary custody

or while the prisoner is otherwise being made available for

trial as required by this agreement, time being served on the

sentence [imposed by the sending state] shall continue to run

. . . ."    Code § 53.1-210, art. V(f); W. Va. Code § 62-14-1,

art. V(f).    Article V(g) of the Interstate Agreement on

Detainers further states that:

        For all purposes other than that for which
        temporary custody as provided in this agreement
        is exercised, the prisoner shall be deemed to
        remain in the custody of and subject to the
        jurisdiction of the sending state and any escape
        from temporary custody may be dealt with in the


                                  8
     same manner as an escape from the original place
     of imprisonment or in any other manner permitted
     by law.

Code § 53.1-210, art. V(g) (emphasis added); W. Va. Code § 62-

14-1, art. V(g) (emphasis added).

     Based on the plain language of the Interstate Agreement on

Detainers, Virginia gained "temporary custody" of Dorr when he

was sent from West Virginia to Virginia to stand trial on the

five criminal offenses in Frederick County.   Code § 53.1-210,

art. V(a)&(d); W. Va. Code § 62-14-1, art. V(a)&(d).    While in

Virginia, Dorr "remain[ed] in the custody of and subject to the

jurisdiction of [West Virginia]."   Code § 53.1-210, art. V(g);

W. Va. Code § 62-14-1, art. V(g).   Dorr remained a West

Virginia prisoner and received credit toward his West Virginia

sentence from August 20, 2009 until April 29, 2010, while he

was incarcerated in Virginia.   See Code § 53.1-210, art. V(g);

W. Va. Code § 62-14-1, art. V(g).   Accordingly, we must

consider whether Dorr should receive credit toward his Virginia

sentence for the time he spent in the Virginia Detention Center

in addition to the credit he received toward his West Virginia

sentence pursuant to the Interstate Agreement on Detainers. 4




     4
       At the Court's direction, the parties also addressed
whether this matter is moot because of Dorr's release from
Virginia custody in April 2012. After considering the
question, the Court determines that the case is not moot.

                                9
     We addressed a similar issue in Carroll v. Johnson, 278

Va. 683, 687, 685 S.E.2d 647, 648 (2009), where we considered

whether John Carroll ("Carroll") "was entitled to a credit

toward his sentence for time served awaiting trial in Virginia

on a detainer from another state."    In language similar to that

used by the Virginia sentencing court in the present case, in

Carroll the sentencing order "provided that Carroll shall be

given credit for time spent in confinement while awaiting trial

pursuant to Code § 53.1-187."   Id. at 697, 685 S.E.2d at 654

(internal quotation marks omitted).   We concluded that:

          [w]hile Carroll was in Virginia custody, he
     was actually serving his New Jersey sentence
     because the Interstate Agreement on Detainers
     provides that he receive credit toward his New
     Jersey sentence for that time. Thus, as a matter
     of law, Carroll is not entitled to credit toward
     his Virginia sentence for the 288 days he spent
     in Virginia custody incident to his trial because
     he was in Virginia's temporary custody as a New
     Jersey prisoner for the limited purpose of being
     tried on his pending Virginia charges.

Id. at 698, 685 S.E.2d at 654 (citations omitted).

     Dorr argues that because the West Virginia sentencing

order provided that his sentence was to "run concurrently with

whatever sentence he received in Virginia," the present case is

unlike Carroll and, therefore, Carroll does not control the

resolution of this case.   We disagree.   Code § 53.1-187 states,

in relevant part, that "[a]ny person who is sentenced to a term

of confinement in a correctional facility shall have deducted


                                10
from any such term all time actually spent by the person . . .

in a state or local correctional facility awaiting trial

. . . ."   Dorr's sentencing order, which contained similar

language to Carroll's sentencing order regarding credit for

time served, provided that Dorr "shall be given credit for time

spent in confinement while awaiting trial, pursuant to Virginia

Code Section 53.1-187."

     As previously stated, Dorr received credit toward his West

Virginia sentence while incarcerated in Virginia from August

20, 2009 until April 29, 2010.   See Code 53.1-210, art. V(g);

W. Va. Code § 62-14-1, art. V(g).      Despite Dorr's argument that

he is entitled to double credit because the West Virginia order

provided that his sentence run "current with" subsequent

Virginia sentences, Virginia law provides that "[w]hen any

person is convicted of two or more offenses, and sentenced to

confinement, such sentences shall not run concurrently, unless

expressly ordered by the court."      Code § 19.2-308.

Importantly, Dorr's Frederick County sentencing order provided

that "[t]he sentences imposed shall be served consecutively to

and not concurrently with each other."

     As we concluded in Carroll, we hold that, as a matter of

law, Dorr is not entitled credit toward his Virginia sentence

for the time he was incarcerated from August 20, 2009 until

April 29, 2010, while he was in Virginia custody serving time


                                 11
for his West Virginia sentence.    See Carroll, 278 Va. at 698,

685 S.E.2d at 654.

            C. Recharacterization of Dorr's Petition

     Dorr argues that

     the circuit court cannot recharacterize a pro se
     litigant's motion as a petition for writ of
     habeas corpus unless the court notifies the
     petitioner that the court intends to
     recharacterize the pleading or warned the
     petitioner that the recharacterization means that
     any subsequent writs of habeas corpus will be
     restricted under Virginia Code § 8.01-654(B)(2).

     Code § 8.01-654(B)(2) "is plain and unambiguous, clearly

limiting the right of a prisoner to file successive petitions

for writs of habeas corpus.   The key provisions of this

statutory language focus on 'the time of filing' the first

habeas petition."    Dorsey v. Angelone, 261 Va. 601, 603, 544

S.E.2d 350, 352 (2001).   Moreover,

     the provisions of Code § 8.01-654(B)(2) require
     a prisoner to include all claims that he intends
     to bring before the court in his first habeas
     petition. Regardless of the manner in which
     that habeas petition is resolved, he may not
     thereafter file a subsequent habeas petition
     that seeks relief based upon any allegations of
     fact that were known to him at the time of the
     initial filing and not included therein.

Daniels v. Warden of the Red Onion State Prison, 266 Va. 399,

403, 588 S.E.2d 382, 384 (2003).

     In Castro v. United States, 540 U.S. 375 (2003), the

Supreme Court of the United States considered whether lower



                                  12
courts may recharacterize a pro se litigant's motion as a

request for habeas relief under 28 U.S.C. § 2255 ("§ 2255").

It concluded that the recharacterization powers of lower courts

are limited in the following way:

     The limitation applies when a court
     recharacterizes a pro se litigant's motion as a
     first § 2255 motion. In such circumstances the
     district court must notify the pro se litigant
     that it intends to recharacterize the pleading,
     warn the litigant that this recharacterization
     means that any subsequent § 2255 motion will be
     subject to the restrictions on "second or
     successive" motions, and provide the litigant an
     opportunity to withdraw the motion or to amend
     it so that it contains all the § 2255 claims he
     believes he has. If the court fails to do so,
     the motion cannot be considered to have become a
     § 2255 motion for purposes of applying to later
     motions the law's "second or successive"
     restrictions.

Castro, 540 U.S. at 383.   We adopt this limitation on a trial

court's power to recharacterize a pro se litigant's pleading in

the present context.   Virginia trial judges must notify pro se

litigants of the potential consequences when recharacterizing

their pleading.   However, if thereafter the pro se litigant is

given the opportunity to withdraw or amend the pleading to

state all then-available claims and does not withdraw the

pleading or agrees to the recharacterization after receiving

notice and warning from the trial judge, then Code § 8.01-654

and its associated limitations apply.




                                13
     Here, Dorr filed a motion for mandamus to compel VDOC to

comply with the circuit court's sentencing order dated April

22, 2010.    Clarke moved to dismiss Dorr's petition,

recharacterizing his motion as a petition for a writ of habeas

corpus.   Dorr responded that he sought mandamus relief, not

habeas corpus relief, and requested that the circuit court deny

Clarke's motion.    The circuit court then recharacterized Dorr's

motion, without providing him notice or an opportunity to be

heard, and ordered that his petition be dismissed.

Accordingly, we hold that Dorr's petition cannot be considered

his first habeas petition for purposes of limiting his right to

file a subsequent habeas petition under Code § 8.01-654.

     Moreover, we conclude that a pro se litigant is not

limited to challenging an unwarned recharacterization on

appeal, but may do so when a later-filed habeas petition is

challenged as being a second habeas application barred by the

successive petitions provision of the statute.    "[T]he very

point of the warning is to help the pro se litigant understand

not only (1) whether he should withdraw or amend his motion,

but also (2) whether he should contest the recharacterization,

say, on appeal."    Castro, 540 U.S. at 384 (emphasis in

original).    Therefore, "[t]he 'lack of warning' prevents [the

pro se litigant from] making an informed judgment in respect to

the latter just as it does in respect to the former."      Id.


                                 14
Accordingly, we hold that "an unwarned recharacterization

cannot count as a [habeas petition] for purposes of the 'second

or successive' provision [in Code § 8.01-654(B)(2)], whether

the unwarned pro se litigant does, or does not, take an

appeal."    See Castro, 540 U.S. at 384.

     Despite this, "[u]nder the doctrine of harmless error, we

will affirm the circuit court's judgment when we can conclude

that the error at issue could not have affected the court's

result."   Forbes v. Rapp, 269 Va. 374, 382, 611 S.E.2d 592, 597

(2005).    Here, Dorr challenged the recharacterization of his

petition on appeal; however, he is not required to do so until

his first actual habeas petition is challenged as being a

second or successive habeas petition barred by the successive

petitions provision of Code § 8.01-654.    Regardless of the

characterization of his petition, Dorr was not entitled to

credit toward his Virginia sentence from August 20, 2009 until

April 29, 2010, because during this time period he was serving

time for his West Virginia sentence.   Accordingly, we hold that

the recharacterization could not have affected the circuit

court's conclusion because, under the rule we announce here,

Dorr would not be barred from filing a future petition for a

writ of habeas corpus as a successive habeas petition, and the

circuit court properly concluded that Dorr was not entitled to




                                 15
credit toward his Virginia sentence for the time he spent in

the Detention Center from August 20, 2009 until April 29, 2010.

                        III. Conclusion

     We hold that: (1) the circuit court did not err in denying

Dorr's petition because he was not entitled to credit toward

his Virginia sentence from August 20, 2009 until April 29,

2010; (2) the circuit court erred in recharacterizing Dorr's

petition without providing him notice and the opportunity to be

heard; and (3) the error was harmless because Dorr was not

required to challenge the recharacterization on appeal and he

was not entitled to credit toward his Virginia sentence from

August 20, 2009 until April 29, 2010.

     For these reasons, we will affirm the judgment of the

circuit court.

                                                       Affirmed.




                               16
