
98 Cal.Rptr.2d 426 (2000)
82 Cal.App.4th 779
Joseph ANDREWS, Petitioner,
v.
The SUPERIOR COURT of Los Angeles County, Respondent;
v.
Robert W. Thomas, Real Party in Interest.
No. B140746.
Court of Appeal, Second District, Division Four.
July 28, 2000.
*427 Andrews & Hensleigh, Joseph Andrews, Barbara J. Hensleigh and John Aumer, Los Angeles, for Petitioner.
No appearance for Respondent.
No appearance for Real Party in Interest.
EPSTEIN, Acting P.J.
The issue in this case is whether a trial court may order counsel to pay both sanctions and his client's share of a discovery referee's fees under Code of Civil Procedure section 128.[1] We conclude that it cannot.

FACTUAL AND PROCEDURAL SUMMARY
Petitioner Joseph Andrews represented Irena Wegricht in her action for breach of an insurance contract and of the implied covenant of good faith and fair dealing in the underlying action, Wegricht v. Underwriters at Lloyd's, London (Super. Ct. L.A. County, No. BC202512). A motion to compel discovery was brought by Ms. Wegricht in the underlying action. The court referred this motion to Robert W. Thomas, retired judge, as discovery referee. The referee made findings, and in response to submissions by the parties, made a second set of findings.
The parties appeared before the trial court for a hearing on defendant's motion for summary judgment in the underlying action. The court granted the motion, and, sua sponte, without prior notice to the parties, took up Ms. Wegricht's objections to the referee's findings and recommendations on the motion to compel. At the conclusion of the hearing, the trial court awarded discovery sanctions against petitioner individually pursuant to sections 2031, subdivision (a)(1) and 2023, subdivisions (a)(8) and (b)(1), in the amount of $2,275.
The court fixed the discovery referee's fees at $4,200 and ordered plaintiff to pay $3,500 and defendants to pay $700. It also ordered petitioner to pay his client's share of the referee's fees: "Further although the question is not clearly answered either by the statutory law or the case lawthe court has carefully considered whether it has power to order that Mr. Andrews pay the plaintiffs portion of the discovery referee's fee. The court has decided that it does have that power, in part under the authority conferred on the court by Code of Civil Procedure section 128, subdivision (A), paragraphs 4 and 5. The court has also considered whether the better exercise of its discretion to employ that power is to employ it in this situation, *428 under all the circumstances, or to refrain from employing it. The court has decided that the wiser exercise of its discretion is to order that Mr. Andrews pay the plaintiffs portion of the discovery referee's fee. Accordingly, the court so orders."
Petitioner filed a petition for writ of mandate. We issued an order to show cause and a temporary stay. We have received no opposition.

DISCUSSION
Petitioner challenges only the order that he pay his client's share of the referee's fees. He contends the trial court abused its discretion. He asserts that under sections 645.1 and 1023, only the parties to an action may be ordered to pay a referee's fees.
Section 645.1 provides: "The court may order the parties to pay the fees of referees who are not employees or officers of the court at the time of appointment, as fixed pursuant to Section 1023, in any manner determined by the court to be fair and reasonable, including an apportionment of the fees among the parties." Section 1023 provides: "The fees of referees are such reasonable sum as the court may fix for the time spent in the business of the reference; but the parties may agree, in writing, upon any other rate of compensation, and thereupon such rates shall be allowed." In Taggares v. Superior Court (1998) 62 Cal.App.4th 94, 72 Cal.Rptr.2d 387, the court observed that "[s]ections 645.1 and 1023 permit the court to order `the parties'not counsel for the parties to pay the referee's fees." (Id. at p. 103, 72 Cal.Rptr.2d 387.)
The statutes petitioner cites do not aid our analysis because they were not the basis of the trial court's order. As we have discussed, the trial court invoked section 128, subdivision (a)(4) and (5). That statute is a codification of trial court powers: "(a) Every court shall have the power to do all of the following: [¶] ... [¶] (4) To compel obedience to its judgments, orders, and process, and to the orders of a judge out of court, in an action or proceeding pending therein. [¶] (5) To control in furtherance of justice, the conduct of its ministerial officers, and of all other persons in any manner connected with a judicial proceeding before it, in every matter pertaining thereto." (See Rutherford v. Owens-Illinois, Inc. (1997) 16 Cal.4th 953, 967, 67 Cal.Rptr.2d 16, 941 P.2d 1203 [discussing both inherent and statutory powers of courts].) The issue before us is whether the trial court was authorized by this statute or by inherent power to order petitioner to pay his client's share of the referee's fees.
It is important to point out what the trial court did not do in this case: it did not justify its order that petitioner's counsel pay the fees of the discovery referee on the basis of the Civil Discovery Act of 1986, sections 2023 and 2031. It may well be that, in a proper case, the burden of such fees could be placed on an erring attorney under the discovery statute. The trial court relied, instead, on section 128 and inherent power.
The leading case on the power of a trial court to impose monetary sanctions is Bauguess v. Paine (1978) 22 Cal.3d 626, 150 Cal.Rptr. 461, 586 P.2d 942. In that decision, the Supreme Court recognized that the Legislature had codified the inherent "supervisory or administrative powers which all courts possess to enable them to carry out their duties [citations]" into section 128. (Id, at p. 635, 150 Cal.Rptr. 461, 586 P.2d 942.) The court held that the award of fees is not authorized by this statute. The Bauguess court explained: "It would be both unnecessary and unwise to permit trial courts to use fee awards as sanctions apart from those situations authorized by statute. If an attorney's conduct is disruptive of court processes or disrespectful of the court itself, there is ample power to punish the misconduct as contempt.... [¶] The use of courts' inherent power to punish misconduct by awarding attorney's fees may imperil the *429 independence of the bar and thereby undermine the adversary system. In cautioning trial courts to use their contempt powers with care, this court has repeatedly stressed the importance of permitting counsel to be a vigorous advocate: `"He has a right to press a legitimate argument and to protest an erroneous ruling." [Citation.] Indeed, so essential is this "fundamental interest of the public in maintaining an independent bar" ... that "a mere mistaken act by counsel cannot render him in contempt of court. Even if a legal proposition is untenable, counsel may properly urge it in good faith; he may do so even though he may not expect to be successful, provided of course, that he does not resort to deceit or to wilful obstruction of the orderly process."' [Citations.]" (Id. at pp. 637-638, 150 Cal.Rptr. 461, 586 P.2d 942.) By this language, the court made it clear that a punitive monetary sanction such as the one before us is not authorized under either section 128 or the inherent powers of the courts.
After Bauguess was decided, the Legislature enacted section 128.5 granting trial courts the power to impose monetary sanctions under specific situations. In 1994, the Legislature adapted the approach of the Federal Rules of Civil Procedure by enacting section 128.7 to replace section 128.5 for actions filed after December 31, 1994. (See discussion in Trans-Action Commercial Investors, Ltd. v. Firmaterr, Inc. (1997) 60 Cal.App.4th 352, 367-369, 70 Cal.Rptr.2d 449.) Here, the trial court did not purport to base its order that petitioner pay his client's share of the referee's fees on either of these two sanction provisions.
We emphasize the narrow nature of our holding. There may very well be circumstances in which it is appropriate to order the attorney for a party to bear the expense of a discovery referee's fees as a monetary sanction under other statutory authority.

DISPOSITION
The petition for writ of mandate is granted. The trial court is directed to vacate its order requiring petitioner to pay his client's share of the referee's fees and to enter a new order for the payment of the fees that is not inconsistent with this opinion. Each side to bear its own costs on appeal.
HASTINGS, J., and CURRY, J., concur.
NOTES
[1]  All statutory references are to the Code of Civil Procedure, unless otherwise indicated.
