I concur with the opinion of Mr. Justice Traynor insofar as it holds that it *816was error not to comply with sections 284 and 285 of the Code of Civil Procedure. I also concur with that opinion insofar as it holds that it was error for the trial court not to comply with the provisions of section 1018 of the Penal Code. However, I dissent from that opinion insofar as it classifies such errors as being merely “procedural,” and insofar as it holds that such errors did not adversely affect “the constitutional right to counsel. ’ ’
The facts upon which I predicate my dissent are as follows : When arraigned on September 4, 1956, Martinez was represented by counsel. This was known to the trial judge and to the prosecutor. It was a matter of record. Thereafter, the record shows, the district attorney’s office had certain negotiations with the lawyer for Martinez. Sometime later the district attorney’s office was “contacted” by the wife of Martinez and “received a message” which, if written, was never produced, that Martinez desired to plead guilty. The wife denied getting in touch with the district attorney. At any rate, the district attorney sent his chief investigator to interview Martinez to ascertain if the latter desired to plead guilty. The attorney for Martinez was not present at, nor was he notified of, that interview. Thereafter, the district attorney ordered the sheriff to produce Martinez in court. Counsel for Martinez was not notified of this hearing. Before the court session started the prosecutor interviewed Martinez and, among other things, asked him if he wanted to discharge his attorney.
All of this was, of course, highly improper. The propriety of the prosecuting officials thus communicating with an accused, and questioning him, without his lawyer being present, when they knew that he had a lawyer, was improper. In civil litigation it would be a serious breach of ethics for a lawyer representing one side of a case to communicate and question the adverse party without at least notification to the lawyer for the adverse party. This rule applies with even greater vigor to a criminal case.
Independently of this invasion of the rights of Martinez, there were other violations of his constitutional rights of an even more serious nature.
On October 9, 1956, when Martinez was brought into court and stated that he was willing to proceed without counsel, as already pointed out, his attorney was not notified. The record shows that the trial court and the prosecutor were then *817fully aware of the fact that Martinez had a lawyer. But, in spite of this fact, Martinez, without counsel, was permitted to withdraw his plea of not guilty, to enter a plea of guilty, to admit being armed with a deadly weapon, to waive a presentence report, to waive time for sentencing and to agree that judgment should be immediately pronounced against him.
The majority holds that because the evidence produced before the referee shows that Martinez waived his constitutional right to counsel, and understood what he was doing at the hearing on October 9th, his right to counsel was not interfered with, and that the failure to comply with sections 284 and 285 of the Code of Civil Procedure was a mere procedural error not warranting the issue of the writ of habeas corpus.
This reasoning disregards one of the obvious purposes and intents of the two code sections. The Constitution of this state (art. I, § 13) grants to an accused the right “to appear and defend, in person and with counsel.” Thus, an accused has an undoubted constitutional right to appear without counsel, and to waive Ms right to counsel. But such accused also has the right to appear by counsel. The Legislature, in aid of that constitutional right, has provided that once counsel has been appointed he may be removed only as provided in sections 284 and 285 of the Code of Civil Procedure.1 Section 284 requires a consent by client and counsel filed with the clerk or an order of court after notice to the client and counsel. Until these sections are complied with petitioner remained the attorney of record and it was error to permit Martinez to proceed in person. (People v. Merkouris, 46 Cal.2d 540, 554 [297 P.2d 999].) The sections are not intended simply to protect the lawyer from being replaced without being heard, but are also aimed at protecting the rights of the accused. The framers of our Constitution saw fit to grant the right to counsel to those accused of crime. In implementing that right the Legislature saw fit to provide that, once counsel has been secured, such counsel cannot be removed except as provided in section 284. This is to protect an accused, a layman, from making legal decisions affecting his freedom, without the opportunity of chosen counsel being there and advising him not only of Ms legal rights, but of the result of his waiver of such rights. It is to protect an accused who is represented *818by counsel from the possibility of duress and pressure being exerted by the court or by the prosecution. It is to protect an accused who has counsel from forfeiting the protection of legal advice except as provided in the code section.
This basic error was aggravated by the failure of the court to comply with the provisions of section 1018 of the Penal Code. Even if the right to have counsel present was waived, this section was not complied with. The majority .correctly holds that when Martinez is supposed to have waived his right to counsel, the court did not “fully inform him of his right to counsel” as required by the section. Thus, at the very time he was pleading guilty he was not only permitted to do so without his lawyer being present, but was not then told of his right to counsel, even though he then had a lawyer. Nor was a finding made, as required by the section, that ‘‘ defendant understands his right to counsel and freely waives it.” The majority correctly points out that the “court made no inquiry to discover whether Martinez had the experience and mental capacity to understand his rights or to determine whether his decision was the result of an intelligent choice freely made by him or of improper influences theretofore brought to bear upon him. . . . Thus there is nothing in the record to suggest an awareness of the statutory requirement, let alone an attempt to comply with it. ’ ’
It was for these very reasons, that is, to protect an accused even from himself, that the three code sections were passed.
It has heretofore been held in In re Breen, 162 Cal.App.2d 235 [328 P.2d 465], and In re Brain, 70 Cal.App. 334 [233 P. 390], that convictions must be set aside where other provisions of section 1018 of the Penal Code have not been followed. The majority recognizes that those two cases are direct authority for the issuance of the writ in the instant case. In order to avoid the rule of these eases, they are “disapproved.” I think that those cases were correctly decided. The basic theory behind them is that the Legislature by section 1018, and also in sections 284 and 285, has seen fit to provide certain safeguards to protect one who waives counsel or purports to discharge his attorney. These safeguards are legislative implementations of the constitutional provision. The Legislature determined that these safeguards were necessary to protect those accused of crime. It is not for this court to say that such safeguards are merely “procedural” and may be disregarded.
*819As already pointed out, the majority admits that error was committed in the present case. The implication is that, had defendant appealed, the error would require a reversal. But such error, it is held, does not require the issuance of the writ of habeas corpus.
How could the accused appeal in the present case ? Without being properly informed of his rights, he purported to discharge his counsel and to plead guilty. He did not know that he had been deprived of his statutory and constitutional rights until long after his time for appeal had passed. By permitting him to discharge his counsel illegally, the court deprived him of legal advice about an appeal at the very time he needed such advice.
I think that the writ of habeas corpus should issue.
These sections clearly apply to criminal cases. (People v. Bouchard, 49 Cal.2d 438, 440 [317 P.2d 971]; Code Civ. Proc., $$ 22 and 24.)