
65 Cal.2d 393 (1966)
In re JOHN WELLINGTON JOHNSON on Habeas Corpus.
Crim. No. 10193. 
Supreme Court of California. In Bank.  
Dec. 2, 1966.
 John Wellington Johnson, in pro. per., and Robert C. Anderson, under appointment by the Supreme Court, for Petitioner.
 Thomas C. Lynch, Attorney General, Doris H. Maier, Assistant Attorney General, and Harold F. Bradford, Deputy Attorney General, for Respondent. *394
 TRAYNOR, C. J.
 In 1963 a jury found petitioner guilty of two counts of unlawfully selling heroin (Health & Saf. Code,  11501) and the trial court imposed consecutive sentences. In this habeas corpus proceeding petitioner contends that the prosecution's evidence at the trial established that the acts charged and adjudged as two separate sales were in fact and law parts of a single transaction constituting only one offense.
 [1] Habeas corpus is a proper remedy to review a sentence in excess of that permitted by law (In re Ward, 64 Cal.2d 672, 675 [51 Cal.Rptr. 272, 414 P.2d 400]; In re Seeley, 29 Cal.2d 294 [176 P.2d 24]) and to correct the judgment so that it will impose the only punishment lawful under the undisputed facts. (Neal v. State of California, 55 Cal.2d 11, 17 [9 Cal.Rptr. 607, 357 P.2d 839].)
 The convictions of two sales of heroin rest on the following undisputed facts: On November 8, 1962, Billie Robertson, an undercover agent for the state narcotic enforcement bureau, arranged to meet petitioner at a bar. They met at 9 p.m. and discussed a sale of heroin to Robertson for $30 a spoon (approximately two grams). Robertson said, "I'll take a spoon ... and if it's good I'll take the five spoons for $30.00 a spoon." Petitioner said, "I'll trust you and ... you can try it out and then give me the bread [money]. ... If it's no good you can bring the stuff back. ... I'll tell you what I'll do ... I'll give you another five [and] ... it will only cost you $250.00 for ten spoons."petitioner left to "get the stuff." Shortly thereafter Robertson met him and he delivered "five spoons" so that Robertson could "try it out." Robertson took the "stuff" to other narcotics agents; they tested it and found that it was an opiate. Robertson telephoned petitioner and agreed to meet him again at 11 p.m. and pay him $150 for the five "spoons." Petitioner asked whether Robertson wanted "the other five for another $100" and Robertson said, "Yeah man, but I don't have the bread [money] right now. I'll take it if you'll trust me until tomorrow."petitioner agreed. At the 11 p.m. meeting Robertson gave petitioner $150 for the five "spoons" that petitioner had already delivered, and petitioner delivered five more "spoons." The other agents, who had waited near by, then arrested petitioner. The agreed balance of $100, of course, was never paid.
 [2] Petitioner's course of criminal conduct during the two hours from 9 until 11 p.m. was a single transaction. It was only because the agent wished to try out some of the "stuff" before buying that the heroin was delivered in two installments instead of one. Furthermore, the two acts of delivery *395 were substantially contemporaneous in time. Although the number of deliveries may be relevant in determining the number of crimes committed, it is not conclusive. The entire transaction must be considered. To find that the two deliveries in this case constituted separate crimes, it would be necessary to attach independent criminal significance to the bifurcation of the delivery, a circumstance that had nothing to do with petitioner's culpability. Since one price was agreed upon at the outset and since petitioner intended from the outset to sell Robertson either 10 spoons for $250 or five spoons for $150, he intended to make but one sale. Moreover, that sale was not carried out over such an extended period of time that the bifurcation of delivery posed separate, independent dangers. Under these circumstances, no legitimate penal purpose would be served by interpreting section 11501 to permit the prosecutor to carve this transaction into two crimes.
 [3] The basic principle that forbids multiple punishment for one criminal act (see People v. Quinn, 61 Cal.2d 551, 555 [39 Cal.Rptr. 393, 393 P.2d 705]; People v. Tideman, 57 Cal.2d 574, 585 [21 Cal.Rptr. 207, 370 P.2d 1007]; People v. Logan, 41 Cal.2d 279, 290 [260 P.2d 20]; People v. Knowles, 35 Cal.2d 175, 188 [217 P.2d 1]) precludes infliction of more than one punishment for the present series of acts directed toward one criminal objective, the single sale of heroin to one customer. (See Neal v. State of California, supra, 55 Cal.2d 11, 18, fn. 1; People v. Roberts, 40 Cal.2d 483, 491 [254 P.2d 501] [possession and transportation of heroin necessarily incident to sale]; People v. Nor Woods, 37 Cal.2d 584, 586 [233 P.2d 897] [obtaining cash and automobile in exchange for used automobile in one transaction held but one theft]; People v. Twedt, 1 Cal.2d 392, 397 [35 P.2d 324] [offering for sale, negotiating for the sale of, and selling securities held one offense under the Corporate Securities Act]; People v. Clemett, 208 Cal. 142, 145 [280 P. 681] [possession, control, and operation of a still held one offense].)
 The judgment and sentence on count two of the information are vacated and set aside. The order to show cause is discharged, and the petition for habeas corpus is in all other respects denied.
 McComb, J., Peters, J., Tobriner, J., Peek, J., Mosk, J., and Burke, J., concurred.
