
29 F.Supp.2d 232 (1998)
Francisco RIOS, Petitioner,
v.
Ron WILEY, Respondent.
No. 1:CV-98-1507.
United States District Court, M.D. Pennsylvania.
December 8, 1998.
Francisco Rios, Montgomery, PA, Donald Cameron, New York City, for Francisco Rios, petitioner.
David M. Barasch, United States Attorney's Office, Harrisburg, PA, Kate L. Mershimer, Williamsport, PA, Diane Cagino, Office of the United States Attorney, James T. Foley U.S. Courthouse, Albany, NY, for Ron Wiley, respondent.

MEMORANDUM
CALDWELL, District Judge.

I. Introduction

Francisco Rios has filed a counseled petition for writ of habeas corpus pursuant to 28 U.S.C. § 2241. The petition was originally filed in the United States District Court for the Northern District of New York, but it was transferred here because Rios was an inmate at the Federal Prison Camp at Allenwood, Pennsylvania, at the time he filed the petition. (He is still at Allenwood.)
Rios is contesting the refusal of the Bureau of Prisons (BOP) to grant him credit on his federal sentence for about 22 months he spent in federal custody on a writ of habeas corpus ad prosequendum issued to New York State authorities. At the time the writ was issued, Rios was serving a state sentence. *233 The BOP has refused to grant him credit on the ground that 18 U.S.C. § 3585(b) allows credit only for time that "has not been credited against another sentence" and New York has already credited him for this time on his New York sentence.

II. Background.

The parties' submissions provide the following facts. On August 6, 1991, Rios was arrested on New York State charges arising from possession of a narcotic on February 13, 1991, and taken into state custody. These charges were related to one of the two charges on which the defendant was later found guilty in federal court. On November 6, 1991, the petitioner was indicted on these federal charges, among others. On November 7, 1991, the state court sentenced him to five to 10 years imprisonment. He remained in state custody.
On November 21, 1991, the United States took Rios for one day pursuant to a writ of habeas corpus ad prosequendum. On March 20, 1992, the United States again took Rios pursuant to a writ of habeas corpus ad prosequendum. While he was with the federal authorities on this second writ, the petitioner was tried and convicted on two of the federal counts against him: (1) conspiracy to distribute heroin and cocaine in violation of 21 U.S.C. § 846; and (2) distribution and possession with the intent to distribute heroin in violation of 21 U.S.C. §§ 812, 841(a)(1) and 841(b)(1)(C).
On January 31, 1994, he was sentenced by the United States District Court for the Southern District of New York to 90 months on each count to run concurrently with each other and concurrently with the state sentence the petitioner was then serving. The sentencing order specifically directed that the petitioner was to receive credit for time served. On February 18, 1994, Rios was returned to New York State authorities.
In calculating the time to be served on the sentence, on May 10, 1994, the BOP designated, nunc pro tunc to January 31, 1994, the New York State Department of Correctional Services as Rios' place for service of his federal sentence. This designation was the BOP's attempt to comply with the sentencing court's directive that the federal sentence run concurrent with the state sentence. However, the BOP did not credit the petitioner for about 22 months of incarceration from March 20, 1992, the date federal authorities took him on his second ad prosequendum writ, until January 31, 1994, the date of his federal sentencing. This time had been credited to his state sentence by state authorities, and the BOP decided that under section 3585(b) petitioner could not also receive credit for it on his federal sentence.
On August 2, 1996, Rios was paroled from his state sentence and released into federal custody for service of the remainder of his 90-month federal sentence. Under current calculations, which assume he will qualify for good-time credits, his scheduled release date is February 12, 2000.
Rios contested the BOP's refusal to give him credit for this 22-month period and exhausted his administrative remedies.

III. Discussion.

In seeking habeas relief, Rios makes three arguments. First, citing Brown v. Perrill, 28 F.3d 1073 (10th Cir.1994), supplementing and clarifying 21 F.3d 1008 (10th Cir.1994), he contends that because he was held for so long under the second ad prosequendum writ, this period became federal custody for which he is entitled to credit on his federal sentence. In fact, the government should now be estopped from refusing him credit for this time since he spent it cooperating with the government in other investigations. Second, it is simply irrational for the length of his sentence to depend on the happenstance of how long after his conviction his sentencing took place. Third, the BOP's refusal to grant him credit for this 22-month period has in effect increased his sentence in contradiction to the authority exercised by the sentencing court to impose a concurrent sentence. In support of the last argument, he cites United States v. Benefield, 942 F.2d 60 (1st Cir.1991).
In opposition, the respondent relies on certain general principles dealing with sentence calculations and the award of credit for presentencing detention time. First, a defendant *234 remains in the primary custody of the sovereign that first arrests him, see Chambers v. Holland, 920 F.Supp. 618, 622 (M.D.Pa.1996) (citing cases), and here that would be New York State. Second, when a defendant is serving a state sentence, an ad prosequendum writ only borrows him for the limited purpose of his appearance at federal proceedings and the defendant is still considered to be in state custody for the purpose of sentencing calculations. See Thomas v. Brewer, 923 F.2d 1361, 1367 (9th Cir.1991). See also United States v. Evans, 159 F.3d 908 (4th Cir.1998). Third, 18 U.S.C. § 3585(b) governs the award of credit for time spent in official detention before sentencing and allows it only when it has not been credited against another sentence.[1] Fourth, under the BOP's interpretation of section 3585(a),[2] the earliest a federal sentence can commence is the date of sentencing. See The Bureau of Prisons' Sentence Computation Manual at 1-13, Program Statement 5880.28 (noting that a prisoner in state custody can begin serving his federal sentence while in state custody as long as the BOP designates the state prison as the place for serving his federal time but emphasizing that: "In no case can a federal sentence of imprisonment commence earlier than the date on which it is imposed.").
Applying these general principles here, the BOP argues that it calculated the petitioner's sentence correctly and properly refused him credit for the 22 months he was with federal authorities under the second ad prosequendum writ. First, Rios had only been "borrowed" from state authorities under the writ and was considered to have remained in the primary custody of the state for this period of time. Second, the petitioner has received credit on his state sentence for this time period and hence awarding credit on his federal sentence is prohibited under section 3585(b) as a "double credit." Third, the BOP gave effect to the concurrent nature of the federal sentence by designating the state prison as the place of federal incarceration from the date of the federal sentencing, the earliest date that the federal sentence could be considered commenced.
Because we find Benefield, supra, persuasive, we agree with the petitioner that he must receive credit on his federal sentence for the 22 months he spent under the second ad prosequendum writ. In Benefield, the defendant was convicted of a federal offense arising from the same set of facts giving rise to the state-court conviction. The defendant was already serving his state sentence at the time of his federal conviction, and the federal court sentenced him to a concurrent sentence. On appeal, the defendant sought, among other things, credit for time served before sentencing, which the government opposed because this time had been credited against his state sentence. The First Circuit granted relief and gave the defendant double credit for this time, explaining:
Benefield was being held in state custody for related state law violations when he was charged with the federal firearm violation currently before us on appeal. He was convicted in both fora. Credit for time served prior to sentencing was awarded against his state sentence. The district court, however, imposed a concurrent federal sentence without granting similar credit. While we appreciate that multiple credit for the same period of presentence incarceration is prohibited under certain circumstances, see 18 U.S.C. § 3585(b) ("A defendant shall be given credit toward the service of a term of imprisonment for any time he has spent in official detention prior to the date the sentence commences ... *235 that has not been credited against another sentence."); United States v. Wilson, 916 F.2d 1115, 1118 (6th Cir.1990) (presentencing custodial detention by the state court may be credited against a federal sentence; however, such credit may not be awarded if the time has already been used against another sentence), an across-the-board prohibition under all circumstances would lead to illogical results. For example, in the instant case any credit granted by the state court was rendered meaningless when not similarly reflected in Benefield's concurrent federal sentence. Thus, in order to avoid this unsuitable result, the federal court should, on remand, impose a period of incarceration commensurate with Benefield's corresponding state sentence.
Id. 942 F.2d at 66-67 (footnote omitted).
Benefield provides us with the correct approach to the issue presented here. A concurrent sentence is a sentence that runs simultaneously in whole or in part with another sentence, see Bullard v. Department of Corrections, 949 P.2d 999 (Colo.1997), but if, as here, a sentence is made to turn on the vagary of when a defendant is sentenced, thereby effectively causing the sentence to be partially consecutive to the other sentence by increasing the total period of incarceration, the sentences are not truly concurrent. Benefield prevents this illogical result, and effectuates the intent of the federal sentencing court to make its sentence concurrent with a related state sentence, by granting credit on the federal sentence for the time spent incarcerated before the federal sentencing, even if this result appears to be prohibited by the literal language of section 3585(b).
Thus, applying Benefield to the instant case requires that the petitioner be granted credit for the 22-month period he spent on the second ad prosequendum writ. The federal court sentenced the petitioner to a concurrent sentence at a time when he was serving his state sentence on the related offense. To effectuate the federal sentence the petitioner must be given credit for this 22-month period, time spent incarcerated before the federal sentencing. Otherwise, the mere happenstance of the timing of the federal sentencing will cause the petitioner to serve a partially consecutive sentence, contrary to the intent of the sentencing court.
This is not a unique circumstance. A double credit can happen in at least one other situation. Federal defendants are entitled to a so-called Willis credit, see Willis v. United States, 438 F.2d 923 (5th Cir.1971), credit for time between the date of arrest and the date of the state sentencing, even though this time might be credited to the state sentence as well.
The BOP's position here would have been correct before 18 U.S.C. § 3584, a part of the Sentencing Reform Act of 1984, Pub.L. No. 98-473, Title II, 212(a)(2), Oct. 12, 1984, 98 Stat.2000, became law. Section 3584 confers authority on the sentencing court to impose a concurrent or consecutive sentence. Before this section became law, district courts had no authority to impose a sentence concurrent to a state sentence. See Cozine v. Crabtree, 15 F.Supp.2d 997, 1020 (D.Or.1998) (citing, among other cases, Gomori v. Arnold, 533 F.2d 871, 875 (3d Cir.1976)). Whether a sentence turned out to be concurrent depended on how the BOP decided to treat it, Cozine, supra, 15 F.Supp.2d at 1020, essentially by its authority to designate an institution where it would be served. Gomori, supra, 533 F.2d at 875. This previous authority must now give way to the district court's current authority to impose a concurrent sentence, which includes the implicit requirement that a defendant receive credit on the federal sentence for time served on the related state offense so that the sentences are truly concurrent. See generally, United States v. Kiefer, 20 F.3d 874, 876 (8th Cir.1994) (requiring credit under U.S.S.G. § 5G1.3(b) for time spent in state custody on a related, concurrent state sentence even though this time had already been credited to the state sentence, noting the purpose of section 5G1.3(b) was to insure that the federal sentence "mostly nearly approximates the sentence that would have been imposed had all the sentences been imposed at the same time.") (quoting the "Background" commentary to section 5G1.3(b)).
*236 Based on the foregoing, we need not address the petitioner's remaining arguments. We will issue an appropriate order.
NOTES
[1]  Section 3585(b) reads as follows:

A defendant shall be given credit toward the service of a term of imprisonment for any time he has spent in official detention prior to the date the sentence commences 
(1) as a result of the offense for which the sentence was imposed; or
(2) as a result of any other charge for which the defendant was arrested after the commission of the offense for which the sentence was imposed;
that has not been credited against another sentence.
[2]  Section 3585(a) reads as follows:

Commencement of sentence.  A sentence to a term of imprisonment commences on the date the defendant is received in custody awaiting transportation to, or arrives voluntarily to commence service of sentence at, the official detention facility at which the sentence is to be served.
