
44 Cal.Rptr.3d 813 (2006)
140 Cal.App.4th 849
The PEOPLE, Plaintiff and Respondent,
v.
Oscar RAMIREZ, Defendant and Appellant.
No. B182791.
Court of Appeal, Second District, Division One.
June 21, 2006.
*814 Derek K. Kowata, under appointment by the Court of Appeal, Beverly Hills, for Defendant and Appellant.
Bill Lockyer, Attorney General, Robert R. Anderson, Chief Assistant Attorney General, Pamela C. Hamanaka, Senior Assistant Attorney General, Lawrence M. Daniels and Timothy M. Weiner, Deputy Attorneys General, for Plaintiff and Respondent.
VOGEL, J.
Oscar Ramirez was charged with carrying a concealed firearm (count 1) and carrying a loaded and unregistered firearm (count 2), with allegations that the offenses were committed for the benefit of a criminal street gang. (Pen.Code, §§ 12025, subd. (a)(2), 12031, subd. (a)(1), 186.22, subd. (b)(1)(A).) Ramirez moved unsuccessfully to suppress evidence (the firearm), and he then entered a no contest plea to Count 1 and admitted the gang enhancement. Count 2 was dismissed and probation was granted. Ramirez appeals, claiming the officer lacked probable cause to stop him and that his suppression motion should have been granted. We agree and therefore reverse the judgment.

DISCUSSION

A.
As a police officer watched from his patrol car, Ramirez crossed diagonally at the intersection of Blackwelder and Cloverdale, walking toward the patrol car as it approached the intersection and then stopped at a stop sign. From previous contacts, the officer knew Ramirez (who had been the victim of a shooting) and knew he lived on a corner of the intersection he was crossing. The officer concluded that Ramirez was a "pedestrian in a roadway" and thus in violation of Vehicle *815 Code section 21954, subdivision (a).[1] When Ramirez was within a few feet of the front of the patrol car, he looked at the officer, then turned and started back across the street toward his house.
The officer drove his patrol car up to Ramirez, and said, "Oscar. Hey, hold on. I want to talk to you." When Ramirez stopped, the officer told him to put his hands on top of his head. As the officer was getting out of his car, Ramirez turned and ranbut was stopped within two or three feet, at which time he was asked if he "had anything on him." Ramirez said he had a gun in his pocket, which the officer retrieved. Ramirez was arrested and charged as noted above.

B.
Ramirez contends the officer lacked probable cause to stop him for a violation of section 21954 (or for any other reason). We agree.
The fact that Ramirez was not in a crosswalk while a car was on the roadway does not mean he was crossing in violation of section 21954, subdivision (a), only that he was required to use a high degree of care (Woods v. Eitze (1949) 94 Cal.App.2d 910, 917, 212 P.2d 12; Biggar v. Carney (1960) 181 Cal.App.2d 22, 28, 5 Cal.Rptr. 94; Lang v. Barry (1945) 71 Cal.App.2d 121, 124, 161 P.2d 949; Stockstill v. South Laguna Disposal Co. (1969) 1 Cal.App.3d 1022, 1027, 82 Cal.Rptr. 268), and the manner in which he was crossing did not automatically give the officer (or any motorist) the right to claim the right-of-way (Servito v. Lynch & Sons Van & Storage Co. (1961) 191 Cal.App.2d 799, 808-809, 13 Cal.Rptr. 313). The rights of pedestrians and automobile drivers are reciprocal (Morgan v. Los Angeles R. & G. Corp. (1930) 105 Cal.App. 224, 229-230, 287 P. 152), and the only practical effect of subdivision (a) of section 21954 is that a pedestrian crossing outside a crosswalk must yield the right of way to passing automobiles so that he does not constitute an immediate hazard to others on the road (Hill v. Wilson (1954) 124 Cal.App.2d 472, 474-476, 268 P.2d 748).
With one exception, the cases interpreting subdivision (a) of section 21954 (as illustrated by those cited in the preceding paragraph) arise in the civil context. The one criminal case is People v. McNeil (2002) 96 Cal.App.4th 1302, 118 Cal. Rptr.2d 54, where the defendant was searched (and drugs were found) after he was arrested under an Oakland ordinance that prohibited a person from standing in the roadway (other than in a crosswalk) in a manner that interfered with "the lawful movement of traffic." (Id. at p. 1304, fn. 1, 118 Cal.Rptr.2d 54.) The trial court suppressed the drugs on the ground that the ordinance was preempted by the conflicting provision in section 21954, subdivision (a). On appeal, the Attorney General conceded the preemption claim but insisted the ordinance was "presumptively valid" and, therefore, that the arrest was made in good faith. The Court of Appeal disagreed, noting that the ordinance's enforceability had previously been so undermined that law enforcement personnel could not reasonably rely upon it as a basis for making an arrest. (People v. McNeil, supra, 96 Cal.App.4th at pp. 1305-1309, 118 Cal.Rptr.2d 54.)

C.
We have a different question in our case, and that is whether the officer's reliance *816 on section 21954, subdivision (a), was anything more than an impermissible ruse to stop and search Ramirez. We see only a subterfuge, and no legal basis for the stop.
For purposes of the Fourth Amendment, Ramirez's detention was proper only if the officer in fact had a reasonable and articulable suspicion that Ramirez was a "pedestrian upon a roadway at a[] point other than within a marked crosswalk or within an unmarked crosswalk at an intersection [and did not] yield the right-of-way to all vehicles upon the roadway so near as to constitute an immediate hazard." (§ 21954, subd. (a); Wilson v. Superior Court (1983) 34 Cal.3d 777, 784, 195 Cal.Rptr. 671, 670 P.2d 325; Florida v. Royer (1983) 460 U.S. 491, 498-499, 103 S.Ct. 1319, 75 L.Ed.2d 229.) "Reasonable suspicion" requires specific, articulable facts which, together with objective and reasonable inferences, form a basis for suspecting that Ramirez was engaged in criminal conduct. (U.S. v. Twilley (9th Cir.2000) 222 F.3d 1092, 1095.)
What did the officer see? A man crossing an intersection diagonally who was already three-quarters of the way from one side of the street to the other. There was no crosswalk, but the intersection was controlled by four-way stop signs, and the only visible vehicle was the officer's patrol car, which not even the officer suggested posed an "immediate hazard" to either Ramirez or the officer or his vehicle or anyone else. In short, there was no violation of section 21954, subdivision (a), and there is no way that the officer could have believed there was a violation.
We dismiss as wishful thinking the Attorney General's erroneous assertion that Ramirez crossed "directly in front of an oncoming vehicle," failed to yield the right of way, and created "an immediate hazard"because the record shows just the opposite. The officer himself testified that he was approaching the intersection (and therefore the stop sign) when he first saw Ramirez crossing diagonally toward the patrol car, and that Ramirez then turned around and went back the other way. There were no other cars driving on the street, and the officer testified that Ramirez was "not impeding" his way. If anyone was "impeding" anyone else, it was the officerwho pulled his patrol car into the intersection and stopped to talk to Ramirez. It follows, then, that we also reject the Attorney General's reliance on People v. Allen (1980) 109 Cal.App.3d 981, 985-986, 167 Cal.Rptr. 502, which permits detention when a lawfully stopped suspect attempts to flee, thus delaying performance of the officer's "official duty." Because there was no legal basis for the initial stop, Allen is inapposite. Finally, we reject the Attorney General's suggestion that the search was lawful because the stop was made in good faithbecause a suspicion founded on a mistake of law cannot constitute the reasonable basis required for a lawful traffic stop. (People v. White (2003) 107 Cal.App.4th 636, 643-644, 132 Cal.Rptr.2d 371; In re Justin K. (2002) 98 Cal.App.4th 695, 699-700, 120 Cal.Rptr.2d 546; People v. McNeil, supra, 96 Cal.App.4th at pp. 1307-1309, 118 Cal. Rptr.2d 54.)
It follows that Ramirez's motion to suppress should have been granted and that he must be allowed to withdraw his no contest plea. Aside from the fact that the error is by its nature prejudicial, the concept of harmless error is irrelevant where, as here, a defendant pleads guilty or no contest after the erroneous denial of his suppression motion. (People v. Ruggles (1985) 39 Cal.3d 1, 13, 216 Cal.Rptr. 88, 702 P.2d 170; People v. Hill (1974) 12 Cal.3d 731, 767-769, 117 Cal.Rptr. 393, 528 P.2d 1, overruled on another point in People v. DeVaughn (1977) 18 Cal.3d 889, 896, *817 fn. 5, 135 Cal.Rptr. 786, 558 P.2d 872; People v. Holmsen (1985) 173 Cal.App.3d 1045, 1049, 219 Cal.Rptr. 598.)

DISPOSITION
The judgment is reversed and the cause is remanded with directions to the trial court (1) to vacate its order denying Ramirez's suppression motion and enter a new order granting the motion; (2) to permit Ramirez to withdraw his guilty plea; (3) to determine whether the People intend to retry the case; and (4) to make such other orders as are necessary and appropriate.
SPENCER, P.J., and ROTHSCHILD, J., concur.
NOTES
[1]  All further section references are to the Vehicle Code. Section 21954, subdivision (a), provides: "Every pedestrian upon a roadway at any point other than within a marked crosswalk or within an unmarked crosswalk at an intersection shall yield the right-of-way to all vehicles upon the roadway so near as to constitute an immediate hazard."
