
46 Cal.2d 810 (1956)
In re Leo R. Friedman, on Behalf of JAMES J. BRUMBACK, on Habeas Corpus.
Crim. No. 5924. 
Supreme Court of California. In Bank.  
June 29, 1956.
 Leo R. Friedman for Petitioner.
 Raymond D. Williamson, William E. Barden, Edmund G. Brown, Attorney General, Clarence A. Linn, Assistant Attorney General, Raymond Momboisse, Deputy Attorney General, Thomas C. Lynch, District Attorney (San Francisco), and Norman Elkington, Chief Assistant District Attorney, for Respondent.
 ASHBURN, J. pro tem.  [fn. *]
 Application on behalf of James J. Brumback for issuance of writ of habeas corpus for admission to bail upon appeal from conviction of two felonies.
 Brumback and others were charged with conspiracy to receive stolen property (Pen. Code,  182, 496) and with buying and receiving stolen property (Pen. Code,  496). Two trials resulted in jury disagreements, but in the third Brumback was convicted on both counts; he was sentenced to state prison for the terms prescribed by law, same to run concurrently. He appealed and promptly obtained from the trial judge a certificate of probable cause and a stay of execution pending appeal, it being ordered that he be confined in the county jail during that period (Pen. Code,  1243, 1244). [1] Application for bail on appeal was made; it was denied on the day following the issuance of the stay. In making that ruling, the trial judge voiced opinions indicating that he would grant the bail application if authorized to do so but "stated that under prior decisions ... he had no discretion to allow bail on appeal and had to deny bail pending appeal where no extraordinary circumstances had arisen since the verdicts finding appellant guilty and the pronouncement of judgment and that the only time he had power and discretion to allow bail on appeal was when circumstances of an extraordinary character had intervened between the verdict of the *813 jury and the pronouncement of sentence and judgment."  [fn. 1]
 Appellant's counsel, as petitioner herein, asserts that this was a refusal to exercise a discretion reposed in the trial judge (Pen. Code,  1272, subd. 3).  [fn. 2] The argument is sound. The judge merely made an erroneous determination that he had no discretion in the premises. [2] That was the equivalent of the familiar refusal to exercise jurisdiction because of a mistaken view that same does not exist; in such case the error does not divest jurisdiction and its exercise can be compelled by an appropriate proceeding such as mandamus (13 Cal.Jur.2d  56, p. 551; 1 Witkin California Procedure,  163, p. 430.) A refusal to exercise an existing judicial discretion falls in the same category (Crocker v. Conrey, 140 Cal. 213, 218 [73 P. 1006]; People v. Perdue, 48 Cal. 552, 553).
 The trial judge erroneously applied to his court, by way of restriction upon its power, a rule that has been promulgated principally as an aid to the exercise of the discretion of an appellate tribunal. [3] It is settled that the primary discretion belongs to the trial judge and that it is a sound legal discretion to be exercised in the light of all attending circumstances. (See Ex parte Hoge, 48 Cal. 3, 5; Ex parte Turner, 112 Cal. 627, 629 [45 P. 571]; People v. Perdue, supra, 48 Cal. 552; People v. January, 70 Cal. 34 [11 P. 326]; In re Torres, 80 Cal.App.2d 579, 580 [182 P.2d 573]; People v. Eiseman, 69 Cal.App. 143, 146 [230 P. 669]; In re Wilkins, 66 Cal.App. 754 [226 P. 964]; People v. Hall, 115 Cal.App.2d 144, 148 [251 P.2d 979].) [4] He should recognize that the primary purpose of bail, before or after conviction, is practical assurance that defendant will attend upon the court when his presence is required. [5] Where the trial judge has passed upon the merits of the application his ruling will not be disturbed unless a manifest abuse of discretion appears (Ex parte Turner, supra, 112 Cal. 627, 629; People v. Davis, 67 Cal.App.2d 837, 839 [155 P.2d 675]; In re Torres, supra, 80 Cal.App.2d 579, 580; People v. Ephraim, 72 Cal.App. *814 479, 481 [237 P. 801]; People v. Cornell, 28 Cal.App. 654, 657 [153 P. 726]; People v. Eiseman, supra, 69 Cal.App. 143, 146; In re Malotte, 134 Cal.App.2d 58 [285 P.2d 114]), or "circumstances of an extraordinary character have intervened since conviction which make such action obviously proper." (Ex parte Turner, supra, 112 Cal. 627, 629.) This latter test, as announced in Ex parte Marks, 49 Cal. 680, 683 (an application heard by Mr. Chief Justice Wallace), seems to apply to action by the trial judge as well as that of an appellate court. It is there said: "I think that upon the true construction of the statute (in view of the provision which authorizes a stay of proceedings pending an appeal in a criminal case upon certificate of probable cause), bail upon appeal should not be allowed, except by a judge authorized to grant a certificate, and then only in cases where circumstances of an extraordinary character have intervened." But the Chief Justice was discussing the question of granting bail upon an original application made to him in a case wherein there appears to have been no action, affirmative or negative, by the lower court. In a long line of later decisions the test of intervening extraordinary circumstances has been stated but its application has been confined to action by the appellate court.
 In the following cases the rule was announced and applied in reviewing the quality of the discretion actually exercised by the lower court: Ex parte Turner, supra, 112 Cal. 627, 629; People v. Davis, supra, 67 Cal.App.2d 837, 839; In re Torres, supra, 80 Cal.App.2d 579, 580; People v. Ephraim, supra, 72 Cal.App. 479; In re Ephraim, 73 Cal.App. 104 [237 P. 801]; Ex parte Smith, 89 Cal. 79, 80 [26 P. 638]; People v. Cornell, supra, 28 Cal.App. 654, 658, 659; People v. Yant, 26 Cal.App.2d 124 [78 P.2d 1042]; In re Burnette, 35 Cal.App.2d 358 [95 P.2d 684]; In re Pantages, 209 Cal. 535 [291 P. 831]; People v. Eiseman, supra, 69 Cal.App. 143, 148, 149; Ex parte Hatch, 15 Cal.App. 186 [114 P. 410]; In re Wilkins, supra, 66 Cal.App. 754, 756; Matter of Preciado, 30 Cal.App. 323, 328-329 [158 P. 1063]; In re Ward, 127 Cal. 489, 490 [59 P. 894, 47 L.R.A. 466]; People v. Barton 68 Cal.App.2d 646 [157 P.2d 34]. In these cases it likewise was invoked in the absence of action by the trial judge: Ex parte Smallman, 54 Cal. 35, 36; Ex parte Brown, 68 Cal. 176, 183 [8 P. 829]; In re Albori, 95 Cal.App. 42, 58 [272 P. 321]; People v. Keyes, 100 Cal.App 352 [279 P. 833].
 There appears to be no case in which it has been held *815 that this test limits the discretion of the trial judge. Were that rule applied as the trial judge did in this instance it would virtually nullify section 1272, subdivision 3, for it would preclude a successful early application for bail and necessitate defendant's serving part of his term in the penitentiary or sojourning in jail until some new and untoward and unexpected circumstance, like illness or discovery of new and convincing evidence, should eventuate. [6] Absence of intervening extraordinary circumstances cannot prevent the trial judge from acting or excuse his failure to act, although their presence properly may influence his discretion. It follows that the judge in the present instance mistakenly declined to exercise his discretion.
 [7] It is true that the primary discretion in the matter of bail on appeal resides in the trial court but it is not correct to say that "[i]t always has been the law in this state that the discretion referred to in section 1272 of the Penal Code ... is not a discretion conferred upon the appellate courts," as stated in People v. Davis, 67 Cal.App.2d 837, 839 [155 P.2d 675]; and the cases cited on page 839 do not support that proposition. There is no question of power here presented. The Constitution (art. VI,  4 and 4b) confers upon the Supreme Court and the District Courts of Appeal and each individual justice the right to issue the writ of habeas corpus, and Penal Code, section 1490,  [fn. 3] makes it a proper avenue for obtaining bail. The requirement of intervening extraordinary circumstances is a self-imposed criterion for the guidance of appellate courts and individual appellate justices in the exercise of a sound judicial discretion. [8] The cardinal rule is that manifest abuse of discretion must appear as a basis for the exercise of a sound discretion by an appellate court or justice; the intervening circumstance test is a supplementary one designed to enable the court of review to do justice even though it has become too late for the trial judge to do so. It operates by way of enlargement of the concept of permissible discretion and not as a restriction upon the power of trial or appellate court. In any event that test is not exclusive. [9] The trial judge may grant bail in his discretion though no intervening circumstance has occurred and the appellate court may act *816 where an abuse of discretion appears regardless of the existence of intervening extraordinary circumstances. But if they have occurred affirmative action by the upper court may be appropriate though no abuse of discretion in the trial court appears. In the present instance no discretion was exercised below and no intervening circumstances now appear. Appellant is entitled to have his application considered on the merits but not in this court at this time.
 [10] The petition discloses that application "for a similar writ" was made to the District Court of Appeal, First Appellate District (the court in which defendant's appeal is pending), "on the same grounds as herein alleged"; that same was denied on May 28, 1956, through a minute order reading: "Petition for Writ of Habeas Corpus denied with leave to petitioner or appellant to again apply for bail before the Superior Court. Bail to be granted or denied in the Superior Court's discretion." Petitioner did not follow the course suggested by the District Court of Appeal. His explanation of failure to make a new application to the superior court is "that application had already been made to the Judge thereof who refused to exercise his discretion in the matter upon the ground, as alleged in the petition, that he was without power to grant bail on appeal in the absence of extraordinary circumstances having arisen since the verdicts of guilty that would justify such action. That to apply to the Superior Court for bail would have been a futile and useless act. That pursuant to the rules of said Superior Court a new application for bail would have had to be made before the same Judge who heard the original application." This explanation is not sufficient. The district court plainly ruled that the trial judge does have discretion in the matter and the language of the order, read in the light of the expressed basis for the trial judge's ruling, means that the criterion of intervening extraordinary circumstances does not bind him. If the district court had considered that test to be controlling in the trial court it would have denied the petition and would not have given leave to apply again, nor would it have stated that the superior court was to grant or deny the application in its discretion. Petitioner's belief that the trial judge would not get the point or would not conform to the order is not sufficient reason for his foregoing the suggested remedy and applying directly to this court.
 [11] Since 1874, when People v. Perdue, supra, 48 Cal. 552, was decided, it has been settled practice for an appellate *817 court to refuse to act upon a bail application before disposition of the matter upon the merits in the trial court. In that case it was said, at page 553: "The facts and circumstances going to make up the legal discretion in the sound exercise of which the prisoner may be admitted to bail, are necessarily within the knowledge of the Judge who presided at the trial, and, in practice, the power to admit to bail pending the appeal, ought not to be exercised by us in the first instance, or until after the determination of the application below upon its merits."
 "The motion made here must, therefore, be denied, with leave to the prisoner to renew the application to the Judge of the Court below." Accord: People v. January, supra, 70 Cal. 34, 35; People v. Oreck, 69 Cal.App.2d 317, 318 [158 P.2d 940]; In re Torres, supra, 80 Cal.App.2d 579, 582; In re Malotte, supra, 134 Cal.App.2d 58, 59; In re Brahm, 98 Cal.App. 731, 733 [277 P. 895]; In re Martin, 51 Cal.App. 706, 707 [197 P. 365]. The opinion in People v. Oreck, supra, at page 318, aptly says: "The trial judge is in a better position than members of an appellate court to fix the amount. The law and the facts are fresh in the mind of the trial judge. He has an opportunity to observe the conduct of the accused and to consider factors too numerous to mention herein, in addition to the matters that may be considered as set forth in Penal Code, section 1275, that play a part in ascertaining an amount that will insure the presence of the accused when required."
 The order to show cause is discharged and the petition for habeas corpus is denied without prejudice to renewed application to the superior court for bail on appeal.
 Gibson, C.J., Shenk, J., Carter, J., Schauer, J., Spence, J., and McComb, J., concurred.
 "1. As a matter of right, when the appeal is from a judgment imposing a fine only."
 "2. As a matter of right, when the appeal is from a judgment imposing imprisonment in cases of misdemeanor."
 "3. As a matter of discretion in all other cases."
NOTES
[fn. *]  *. Assigned by Chairman of Judicial Council.
[fn. 1]  1. The foregoing quotation from the petition fairly summarizes the ruling of the trial judge as shown by the return.
[fn. 2]  2. Pen. Code,  1272. "After conviction of an offense not punishable with death, a defendant who has appealed may be admitted to bail:
[fn. 3]  3. This section has not been superseded by rule 32(b) of the Rules on Appeal. The code section and the rule provide parallel and consistent remedies.
