
46 Cal.2d 269 (1956)
VICTOR BADILLO, Petitioner,
v.
SUPERIOR COURT OF THE CITY AND COUNTY OF SAN FRANCISCO, Respondent.
S. F. No. 19346. 
Supreme Court of California. In Bank.  
Feb. 24, 1956.
 MacInnis, Alaga & Glassman and Harry P. Glassman for Petitioner.
 Edmund G. Brown, Attorney General, Clarence A. Linn, Chief Assistant Attorney General, and Arlo E. Smith, Deputy Attorney General, for Respondent.
 TRAYNOR, J.
 By information petitioner was charged with possessing heroin in violation of Health and Safety Code, section 11500. His motion to set aside the information on the ground that the evidence against him was obtained by an illegal search and seizure was denied, and he now seeks a writ of prohibition to prevent his trial.
 Evidence was presented at the preliminary hearing of the following facts: At approximately 6 p. m. on January 6, 1955, federal narcotics Agents Hipkins and Casey and Officers Getchell and McKinley of the San Francisco Police Department went to a house on Sycamore Street in San Francisco. Agent Hipkins remained in front of the house, and the three other officers went to the rear. Officer Getchell knocked at the back door, which was locked, and received no response. He then forced the door open and entered the house followed by Agent Casey. Shortly thereafter, petitioner, followed closely by Officer Getchell, ran out the front door and threw a package of heroin toward Agent Hipkins, who recovered it. None of the officers had a search warrant.
 [1] In Rogers v. Superior Court, ante, p. 3 [291 P.2d 929], we held that a "defendant has been held to answer without reasonable or probable cause if his commitment is based entirely on incompetent evidence," (ante, at p. 7) and accordingly, in such a case the trial court should grant a motion to set aside the information (Pen. Code,  995), and if it does not do so, a peremptory writ of prohibition will issue to prohibit further proceedings. (Pen. Code,  999a.) No problem is presented in applying this rule in cases involving searches and seizures in which the facts bearing on the legality of the search or seizure are undisputed and establish as a matter of law that the evidence is or is not admissible. [2] In many cases, however, the evidence *272 before the magistrate bearing on this issue may be in conflict or susceptible of conflicting inferences or consist only of the testimony of prosecution witnesses, and under these circumstances the court in ruling on a motion to set aside the information will frequently not be in a position to make a final determination as to the admissibility of the evidence. Accordingly, the information should not be set aside on the ground that essential evidence was illegally obtained if there is any substantial evidence or applicable presumption to support a contrary conclusion (see People v. Michael, 45 Cal.2d 751, 753-754 [290 P.2d 852]; People v. Martin, 45 Cal.2d 755, 761-762 [290 P.2d 855]), and in such cases the ultimate decision on admissibility can be made at the trial on the basis of all of the evidence bearing on the issue. (See People v. Gorg, 45 Cal.2d 776, 780-781 [291 P.2d 469]; People v. Berger, 44 Cal.2d 459, 464 [282 P.2d 509].) [3, 4] In the absence of evidence to the contrary, it is presumed that the officers acted legally (see People v. Farrara, ante, p. 265 [294 P.2d 21]), and if the issue is raised for the first time on a motion to set aside the information, the motion should be denied unless the evidence before the committing magistrate establishes that essential evidence was illegally obtained. [5] When, however, the question of the legality of an arrest or of a search and seizure is raised either at the preliminary hearing or at the trial, the defendant makes a prima facie case when he establishes that an arrest was made without a warrant or that private premises were entered or a search made without a search warrant, and the burden then rests on the prosecution to show proper justification. (Dragna v. White, 45 Cal.2d 469, 471-472 [289 P.2d 428]; Coverstone v. Davies, 38 Cal.2d 315, 319 [239 P.2d 876]; Hughes v. Oreb, 36 Cal.2d 854, 858 [228 P.2d 550]; People v. Boyles, 45 Cal.2d 652, 656 [290 P.2d 535]; People v. Gorg, supra, 45 Cal.2d 776, 782-783.)
 [6] In the present case defendant made a prima facie showing of illegal entry by establishing that the officers broke into the house without a search warrant, and the burden then rested on the prosecution to introduce evidence that the officers had reasonable cause to break and enter to make an arrest. (See Pen. Code,  844.) Since no such evidence was presented, it must be taken as established for the purposes of this proceeding that the entry into the house was unlawful,  [fn. *]*273 and it is immaterial whether or not it was defendant's house. (People v. Martin, supra, 45 Cal.2d 755, 760-761.)
 [7] The attorney general contends that defendant abandoned the evidence when he threw it toward Agent Hipkins and that therefore he may not object to its use against him. It clearly appears, however, that defendant's flight out the front door and attempted disposal of the evidence was the direct result of Officer Getchell's illegal entry, and accordingly, the evidence was obtained in violation of constitutional guarantees. (Silverthorne Lbr. Co. v. United States, 251 U.S. 385, 392 [40 S.Ct. 182, 64 L.Ed. 319, 24 A.L.R. 1426]; People v. Berger, 44 Cal.2d 459, 462 [282 P.2d 509]; People v. Stewart, 232 Mich. 670 [206 N.W. 337, 338].)
 Let the peremptory writ of prohibition issue as prayed.
 Gibson, C.J., Schauer, J., and McComb, J., concurred.
 CARTER, J.
 I concur in the judgment and generally in the reasoning in the majority opinion but I wish to point out that under a recent decision of the Supreme Court of the United States (Dantan George Rea v. United States of America, January 16, 1956, 350 U.S. 214 [76 S.Ct. 292, 100 L.Ed. ___]) it would seem that evidence illegally obtained by federal agents would not be admissible in a state court notwithstanding the rule announced by this court in People v. Cahan, 44 Cal.2d 434 [282 P.2d 905].
 SPENCE, J.
 I dissent.
 Petitioner was charged with the possession of heroin in violation of section 11500 of the Health and Safety Code. Possession of narcotics is in the nature of a continuing offense, and the evidence shows that petitioner had committed and was committing the offense at the time of the arrest and search. I am therefore of the opinion that this case presents two material questions: (1) whether the arrest without a *274 warrant was a lawful arrest; and (2) if so, whether the search was reasonable as an incident to such lawful arrest.
 Heretofore this court has deemed it unnecessary to determine whether an arrest without a warrant under the circumstances presented here is a lawful arrest under subdivision 2 of section 836 of the Penal Code. It was so declared in People v. Brown, 45 Cal.2d 640, at page 643 [290 P.2d 528], where it was held that "the legality of an arrest is not necessarily determinative of the lawfulness of a search incident thereto." This court further said: "Moreover, whether or not the arrest of a guilty defendant is lawful, it is clearly unreasonable if the officer has no 'reasonable cause' to believe the defendant guilty, and a search incident thereto can be no more reasonable than the arrest itself." (P. 644.) Thus it appears that this court has made a distinction between a lawful arrest and a reasonable arrest. I had doubt concerning the validity of any such distinction, and it was for this reason that I voted for a rehearing in People v. Brown, supra, 45 Cal.2d 640, and People v. Simon, 45 Cal.2d 645 [290 P.2d 531]. I have concluded that the question of the lawfulness of the arrest is a material one in the determination of the present case and of other pending cases, and that it should be decided here.
 Section 836 of the Penal Code provides: "A peace-officer may ... without a warrant, arrest a person:"
 "1. For a public offense committed or attempted in his presence."
 "2. When a person arrested has committed a felony, although not in his presence."
 "3. When a felony has in fact been committed, and he has reasonable cause for believing the person arrested to have committed it."
 "4. On a charge made, upon a reasonable cause, of the commission of a felony by the party arrested."
 "5. At night, when there is reasonable cause to believe that he has committed a felony."
 In my opinion, the arrest without a warrant in the present case was lawful under the above-quoted subdivision 2. An analysis of section 836 shows that there is a marked difference between the provisions of subdivision 2 and those of subdivisions 3, 4, and 5. The three last-mentioned subdivisions specify the circumstances under which "reasonable cause" is required in order to make lawful an arrest without a warrant, but subdivision 2 makes no mention of "reasonable *275 cause" and makes lawful an arrest without a warrant "when a person arrested has committed a felony."
 In determining the lawfulness of an arrest, all subdivisions of section 836 must be considered together, and subdivision 2 must be given its obvious meaning. If we depart from the clear language of that subdivision by engrafting thereon an additional requirement of "reasonable cause," we do violence to the terms of the subdivision and also render it meaningless and purposeless. The remaining subdivisions cover those lawful arrests which require "reasonable cause" and cover every arrest which might be made under subdivision 2 if an arrest under subdivision 2 is held to be conditioned upon an unexpressed requirement of "reasonable cause." We cannot assume that the Legislature intended to enact a purposeless provision when it included subdivision 2 in that section, but that conclusion is inevitable if we fail to give effect to its plain and unambiguous terms. I therefore conclude that an arrest without a warrant is a lawful arrest if the person arrested has committed a felony, regardless of whether the arresting officer acted upon such prior knowledge as might be deemed to constitute "reasonable cause." Of course the arresting officer acts at his peril (Hughes v. Oreb, 36 Cal.2d 854 [228 P.2d 550]; Coyne v. Nelson, 107 Cal.App.2d 469 [237 P.2d 45]), but there appears to be no sound reason for holding the arrest unlawful if the person arrested has in fact committed a felony. It further appears that the officer making such lawful arrest may do so by using such means as are sanctioned by section 844 of the Penal Code. (People v. Martin, 45 Cal.2d 755 [290 P.2d 855].)
 The question remains as to whether the search and seizure here made was reasonable as an incident of a lawful arrest.
 Since the adoption of the exclusionary rule, which declares inadmissible any evidence obtained through "unreasonable searches and seizures" (People v. Cahan, 44 Cal.2d 434 [282 P.2d 905]; People v. Berger, 44 Cal.2d 459 [282 P.2d 509]; People v. Tarantino, 45 Cal.2d 590 [290 P.2d 505]), this court has been considering a series of cases presenting the question of whether searches under varying circumstances were reasonable or unreasonable. In deciding these cases, this court has been endeavoring to establish "workable rules governing searches and seizures" and is committed to the avoidance of "needless refinements and distinctions" and "needless limitations on the right to conduct reasonable searches and seizures." (People v. Cahan, supra, pp. 450-451.) *276 The unfinished task of establishing such rules is of the utmost importance, not only by reason of the relation of such rules to the application of the exclusionary rule but also because of their relation to actions which may be brought against law enforcement officers, seeking to impose criminal and civil sanctions upon them for the making of searches which may be claimed to be unreasonable.
 The inherent difficulty of establishing logical, workable, and understandable rules to supplement the exclusionary rule has been generally recognized. It seems clear, however, that in establishing these rules, we should endeavor to balance the interests of the individual with the interests of society; that we should not unduly hamper the legitimate efforts of those who are charged with the solution of the perplexing problems of law enforcement; and that we should not unnecessarily open unduly wide the avenues of escape for those who apparently have no regard for our laws except insofar as those laws may appear to provide a shield to protect them in their illegal operations. To this end we should not hold unreasonable those searches which may properly be held to be reasonable, and we should strive to formulate logical rules which will establish a consistent pattern to guide our law enforcement officers.
 This court has already properly determined that a lawful arrest, accompanied by a search and seizure incident to such arrest, does not violate constitutional guarantees under certain circumstances regardless of the fact that no warrant of arrest or search warrant may have previously issued. (People v. Boyles, 45 Cal.2d 652 [290 P.2d 535]; People v. Martin, supra, 45 Cal.2d 755.) As above indicated, however, this court has held that the reasonableness of the search incident to the arrest depends not only upon the lawfulness of the arrest, but also upon the reasonableness of the arrest. It is with this conclusion that I cannot agree, for if an arrest is lawful it does not appear appropriate to declare that such lawful arrest is unreasonable.
 As was said in State v. Williams, 328 Mo. 627 [14 S.W.2d 434], at page 436 [14 S.W.2d], in affirming a judgment of conviction based upon evidence obtained through a search incident to an arrest without a warrant: "As applicable to this case it would not matter a particle, when the deputy sheriff made the arrest, whether reasonable ground to believe a felony had been committed was presented to his mind or not; he is justified because the reasonable ground existed; the *277 crime had in fact been committed. That is a complete justification. The arrest was therefore lawful."
 If we are to formulate logical rules which will establish a consistent pattern, it appears to be illogical to hold reasonable the searches made as incidents of lawful arrests in some of the decided cases, and at the same time to hold unreasonable the search made as an incident of a lawful arrest in the present case, as well as the searches made as incidents of lawful arrests in the Brown and Simon cases. The adoption of the rules laid down by the majority opinion here and in the cited cases means that a search made as an incident of an arrest declared lawful by subdivisions 3, 4 or 5 of section 836, is reasonable, regardless of whether the person arrested has or has not committed a felony, provided that the arresting officer acts upon prior knowledge which may be subsequently held to fall within the nebulous realm of "reasonable cause," but that a search made as an incident of an arrest declared lawful by subdivision 2 of section 836 is unreasonable, regardless of the fact that the person arrested has actually committed a felony, unless the arresting officer acts upon prior knowledge which may be subsequently held to fall within that nebulous realm. In my opinion, rules which bring about this undesirable result are illogical, and they fail to establish any consistent pattern. The difficulty can be avoided if one logical, workable, and understandable rule is applied to all cases by holding that if the arrest is lawful, then the search made as an incident of the lawful arrest is a reasonable search, rather than an "unreasonable" search.
 While it is recognized that the guilty as well as the innocent are entitled to the benefit of the constitutional guarantee against "unreasonable searches and seizures" (People v. Cahan, supra; People v. Berger, supra; People v. Tarantino, supra), the cited cases did not present any question of the reasonableness of a search made as an incident of a lawful arrest. The claimed "unreasonable searches" or other invasions of the defendants' rights in those cases were made over a long period of time and without any direct connection with any arrest. Here the search was made as an incident of a lawful arrest, in the sense that it was made at the time and place of such lawful arrest; and in my opinion, it should be held to be reasonable under these circumstances.
 By way of summary, I am of the opinion that the arrest in the present case was a lawful arrest under subdivision *278 2 of section 836 of the Penal Code, as it appears that the petitioner Badillo had committed and was committing a felony at the time of his arrest; that the search was an incident of his lawful arrest and was therefore reasonable, and not in violation of the constitutional guarantee against "unreasonable searches and seizures"; that the evidence obtained by such search was therefore properly admitted upon the preliminary hearing; and that petitioner's motion to set aside the information upon the ground that the evidence was obtained by an alleged "unreasonable" search and seizure was properly denied by the trial court.
 I would therefore discharge the alternative writ of prohibition and deny the peremptory writ.
 Shenk, J., concurred.
NOTES
[fn. *]  *. Although the preliminary hearing in this case was held before the decision in People v. Cahan, 44 Cal.2d 434 [282 P.2d 905], defendant anticipated a possible change in the law, and the magistrate permitted him to establish that the entry was made without a search warrant. Presumably in reliance on the nonexclusionary rule, the prosecution made no attempt to prove that the officers had reasonable cause to enter the house to make an arrest. Since defendant has not been in jeopardy (In re Harron, 191 Cal. 457, 466 [217 P. 728]; see People v. Godlewski, 22 Cal.2d 677, 681-682 [140 P.2d 381]; Pen. Code,  999, 1021), there is nothing to prevent the prosecution from instituting a new proceeding and proving, if it can, that the officers had reasonable cause to enter the premises to make an arrest.
