
476 Pa. 217 (1978)
382 A.2d 124
COMMONWEALTH of Pennsylvania, Appellee,
v.
Calvin McDONALD, Appellant.
Supreme Court of Pennsylvania.
Argued September 29, 1977.
Decided January 26, 1978.
*218 J. Kerrington Lewis, P. Andrew Diamond, Pittsburgh, for appellant.
Robert E. Colville, Dist. Atty., Robert L. Eberhardt, Charles W. Johns, Asst. Dist. Attys., Pittsburgh, for appellee.
Before EAGEN, C.J., and O'BRIEN, ROBERTS, POMEROY, NIX, MANDERINO and PACKEL, JJ.

OPINION
EAGEN, Chief Justice.
On March 2, 1974, Calvin McDonald, a resident of Detroit, Michigan, was arrested in Allegheny County and charged *219 with possession of a controlled substance  heroin valued at $200,000  and possession of a controlled substance with intent to deliver. Bail was set at $100,000 at 8% plus a $25,000 surety bond. The former was secured by a cash deposit of $8,000 with the clerk of courts; the latter was filed by the Allegheny County Casualty Company.
A jury trial began on November 7, 1974. During the trial McDonald failed to appear in court on November 13 and did not appear until the afternoon of November 14. The trial judge, meanwhile, declared his bail forfeited, but directed that the trial continue in his absence. After his return, the jury found him guilty as charged. The court learned that during his absence he had traveled to Detroit, where he had been arrested on other criminal charges. After his conviction in Pennsylvania, the trial court reinstated his bail but directed that the surety bond be increased to $50,000. The Allegheny County Casualty Company filed a second bond in the amount of $25,000, and McDonald was again free on bail.
On April 8, 1975, the Court of Common Pleas granted McDonald a new trial. Previously, however, he had been convicted on an unrelated federal charge, bail pending appeal in that case had been denied, and he had been committed to a federal prison in Indiana. Learning of this, the district attorney of Allegheny County filed a detainer with the federal authorities pursuant to which McDonald was removed to prison in Allegheny County to await his new trial on the Pennsylvania charges.[1]
McDonald then sought to have the detainer vacated, alleging that it was contrary to the court's order permitting him bail. The court refused to vacate the detainer, and McDonald remained in prison. Subsequently, the two $25,000 surety bonds posted by the Allegheny County Casualty Company were rescinded, and the surety exonerated from its *220 obligations under them.[2] McDonald then petitioned the court to return to him the $8,000 bail deposit on the ground that he was now in custody and in effect without bail. At a hearing on July 3, 1975, the hearing judge was advised the money was actually put up by McDonald's family, but the judge declared he wanted "to await the disposition here" and indicated the money would be retained "for safekeeping." The petition was denied.
On July 9, 1975, the court accepted a plea bargain pursuant to which McDonald pleaded guilty to possession of a controlled substance with intent to deliver. He was sentenced to a prison term of six to twelve years, concurrent with his federal sentence, and was ordered to pay a $2,000 fine as well as the costs of prosecution. At this time McDonald's counsel asked the judge to release the $8,000 bail deposit to McDonald's sisters who, he stated, had provided the money from their own funds. The judge refused to hear the testimony of the sisters, who were present in court, and concluded that the Rules of Criminal Procedure permit fines and costs to be deducted from the bail money no matter who supplies it. Accordingly, he ordered the fine and costs to be deducted from the bail money. This was done, and the balance, $5,058.15, was returned to McDonald. On direct appeal the Superior Court affirmed without opinion the order of July 3, the judgment of sentence, and the order deducting the fine from the bail deposit.[3] We granted McDonald's petition for allowance of appeal, and this appeal followed.
McDonald contends that the court erred both in refusing to order the deposit returned on July 3 and in subsequently ordering the fine and cost of prosecution to be deducted *221 from a bail deposit put up by third parties.[4] The Commonwealth responds that the hearing judge acted in compliance with Pa.R.Crim.P. 4015(b), which provides that such deposits shall be returned to the depositor "within (20) days after full and final disposition of the case," and that the fine and costs were properly deducted because the record shows that the defendant deposited the money personally.
In our view, the hearing judge erred in refusing to order the deposit returned on July 3. Rule 4015(b) provides:
"When a sum of money equal to a percentage of the full amount of the bail has been deposited, the issuing authority or clerk of court shall return the same to the depositor within (20) days after full and final disposition of the case less a reasonable charge relating to the costs of administering the percentage cash bail program."
This rule, however, must be read in conjunction with others pertinent to its interpretation.
Pa.R.Crim.P. 3(b) defines bail as "the security required and given for the release of a person in the custody of the law, conditioned upon a written undertaking that he will appear when required and do all other things stipulated therein." [Emphasis added.] Bail is thus put up in exchange for the defendant's release from custody; it secures his future appearance and other requirements of his bond, but it does not secure the payment of fines and costs which may be imposed upon him in the future. See Commonwealth v. Truesdale, 449 Pa. 325, 296 A.2d 829 (1972).
In addition, Pa.R.Crim.P. 4011 provides:
"Unless bail is revoked, the bond shall be valid until full and final disposition of the case, including all avenues of direct appeal to the Supreme Court of Pennsylvania and to the Supreme Court of the United States by writ of certiorari or appeal." [Emphasis added.]
Although McDonald's bail had not been formally revoked on July 3, we conclude that because of the refusal to *222 vacate the detainer and the release of the surety, it had been effectively revoked. Although no forfeiture of the bail had been declared on July 3  see Pa.R.Crim.P. 4016  at that time McDonald no longer had the freedom from custody which the money was deposited to secure. Rule 4015(b) authorizes the retention of a sum of money if it constitutes bail. Bail is given for the release of a person. Since bail was, in effect, revoked by the incarceration of McDonald and the release of the surety, the money no longer constituted bail. Accordingly, the court no longer had the authority under Rule 4015(b) to retain the cash deposit until "full and final disposition of the case." Our conclusion is further supported by Rule 4011 which clearly indicates that revocation of bail invalidates a bond. See State v. Williams, 127 Wash. 658, 221 P. 289 (1923). See and compare Commonwealth v. McMullin, 11 Pa.D. & C. 107 (1927); Commonwealth v. Pulici, 9 Pa.D. & C. 39 (1926). The deposit should have been ordered returned to the depositor minus only "a reasonable charge relating to the costs of administering the percentage cash bail program." Pa.R.Crim.P. 4015(b).
Accordingly, we shall vacate the order of the Superior Court, vacate the order of the Court of Common Pleas denying McDonald's petition to release the bail deposit and the order of the Court of Common Pleas authorizing McDonald's fine and costs to be deducted from the bail deposit, and affirm the judgment of sentence. The record is remanded to the Court of Common Pleas with directions to return the amount of the bail deposit retained to pay McDonald's fine and costs to the depositor, without prejudice to the right of the Commonwealth to collect this amount from McDonald.[5]
It is so ordered.
PACKEL, J., did not participate in the decision of this case.
NOTES
[1]  McDonald alleges that at about this time the court ordered his $8,000 bail deposit "impounded." This alleged order does not appear in the record, which appears to indicate that at all pertinent times the money remained in the possession of the clerk of courts.
[2]  McDonald alleges that the court exonerated the surety's obligations on the bond, pursuant to Pa.R.Crim.P. 4016(B), which provides in pertinent part that "[a] surety may be exonerated . . . by timely surrender of a defendant in custody." The record does not show that the surety was so exonerated, but since the Commonwealth does not deny this allegation, we accept it as true.
[3]  The Superior Court did not specifically affirm the latter order, but it was treated as part of the judgment of sentence by the trial court.
[4]  McDonald couches his argument in terms of due process and equal protection, but, because of our disposition of this appeal, we need not reach constitutional issues.
[5]  We leave it to the Court of Common Pleas to determine whose money was actually deposited on McDonald's behalf, the record being equivocal on this point. We express no view on whether and to what extent the Rules of Criminal Procedure allow bail deposits to be applied to the collection of fines and costs imposed upon the defendant. Compare Pa.R.Crim.P. 4015 with Act of May 12, 1921, P.L. 548, § 2, as amended, 19 P.S. § 72, suspended by Pa.R.Crim.P. 4018(h).
