
100 Wn.2d 757 (1984)
675 P.2d 1213
THE STATE OF WASHINGTON, Respondent,
v.
DAVID KEITH DAVENPORT, Petitioner.
No. 49398-7.
The Supreme Court of Washington, En Banc.
January 12, 1984.
*758 Jonathan S. Cole of Washington Appellate Defender Association, for petitioner.
Norm Maleng, Prosecuting Attorney, and Barbara Corey-Boulet, Deputy, for respondent.
BRACHTENBACH, J.
Petitioner was charged with second degree burglary of a residence in King County. The information charged that the petitioner "in King County, Washington, on or about December 19, 1980, did enter and remain unlawfully in a building, located at 2707 33rd Ave. S., ... with [the] intent to commit a crime... therein".
The State's case was based primarily on the testimony of three witnesses who were neighbors of the burglarized residence. They testified that they saw the petitioner at the scene of the crime on the day of the burglary, carrying property to a car driven by a third party. The property matched the description of property reported as stolen from the burglarized residence. The third party, who was not tried with the petitioner, was identified at trial as Timothy White. All three witnesses also testified that they were acquainted with the petitioner and knew him prior to seeing him on the day of the burglary. None of the witnesses, however, testified to seeing the petitioner actually enter or exit the burglarized residence. In fact, no direct evidence placing the petitioner inside the burglarized residence was presented at trial.
At the close of all testimony both parties submitted instructions. The prosecution did not submit or orally request an instruction on accomplice liability. The "to convict" instruction submitted to the jury stated that in order to convict the defendant, the jury must find beyond a reasonable doubt that "on or about the 19th day of December, 1980, the defendant entered or remained unlawfully in a building ... with [the] intent to commit a crime ... therein".
In closing argument, the State argued that the evidence proved beyond a reasonable doubt that the petitioner *759 entered or remained unlawfully in the residence with the requisite intent and, therefore, was guilty of burglary. Naturally, petitioner in his closing argument argued that the State had not proved its case. In the course of petitioner's argument, he stated that if the driver of the car, Mr. White, had entered the house and handed the stolen property to the petitioner outside the residence, the State had not proven that the petitioner was guilty of the crime he was charged with, entering or remaining unlawfully in a building. In rebuttal, the prosecution stated "it doesn't make any difference actually who went into the house ... they are accomplices". Immediate objection by petitioner was overruled by the trial court. The State then finished its rebuttal closing argument, but never mentioned accomplice liability again.
After the jury retired for deliberation, petitioner moved for a mistrial on the grounds that the prosecutor's comments were improper and prejudicial. This motion was denied. After over 2 1/2 hours of deliberation, the jury sent a note to the trial judge requesting a definition of "`accomplice' in terms of participation in the crime of burglary, i.e., does the defendant have to physically enter and remove the identified items or can he be simply an outside participant?" The trial judge did not send an immediate response and the jury was allowed to go home overnight with the inquiry unanswered. The following morning when the court reconvened, the trial judge sent a note to the jury directing the jury to "rely on the law given in the Court's instructions to the jury." Later that day the jury returned a verdict of guilty.
On appeal, the Court of Appeals, Division One, affirmed the petitioner's conviction. State v. Davenport, 33 Wn. App. 704, 657 P.2d 794 (1983). We reverse.
Petitioner argues that the prosecutor's comment in rebuttal was improper and denied him a fair trial. We agree.


*760 I
[1] We concur with the Court of Appeals holding that the prosecutor's comment was improper. Statements by the prosecution or defense to the jury upon the law must be confined to the law as set forth in the instructions given by the court. State v. Estill, 80 Wn.2d 196, 199, 492 P.2d 1037 (1972). The State neither charged the petitioner as an accomplice under RCW 9A.08.020, nor sought an instruction on accomplice liability at the close of the case. Nevertheless, the prosecutor stated in rebuttal closing argument that it did not matter who entered the building as the petitioner was an accomplice. "Accomplice" is a legal theory of criminal liability. See RCW 9A.08.020. Consequently, the comment is clearly a statement of law that was not contained in the instructions given to the jury and was, therefore, improper.
The State argues the statement is not improper because it was invited by the petitioner's arguments in closing. See State v. Wright, 97 Wash. 304, 166 P. 645 (1917) (remarks of the prosecuting attorney which ordinarily would be improper are not grounds for reversal if they are provoked by defendant's counsel and are in reply to his statement). Accord, State v. La Porte, 58 Wn.2d 816, 365 P.2d 24 (1961); State v. Dennison, 72 Wn.2d 842, 435 P.2d 526 (1967). Whatever invitation the petitioner's remarks in closing may have engendered, the State's "response" in this case clearly exceeded the scope of that invitation.
Petitioner's closing argument correctly pointed out that if the petitioner never entered the residence, he could not be found guilty of the crime he was charged with and upon which the jury was instructed, second degree burglary (entering or unlawfully remaining in a building). While arguing his theory of the case in closing argument, the petitioner never mentioned accomplice liability. Petitioner simply and correctly relied upon the fact that no direct evidence placed the petitioner in the burglarized residence, and the prosecutor had not charged the petitioner as an accomplice in the burglary of the residence, or sought an *761 instruction on accomplice liability.
While the petitioner's comments in closing argument invited a response, as all closing arguments should, the prosecutor's response in rebuttal was "it doesn't make any difference actually who went into the house ... they are accomplices".
As a general rule, remarks of the prosecutor, including such as would otherwise be improper, are not grounds for reversal where they are invited, provoked, or occasioned by defense counsel and where [the comments] are in reply to or retaliation for [defense counsel's] acts and statements, unless such remarks go beyond a pertinent reply and bring before the jury extraneous matters not in the record, or are so prejudicial that an instruction would not cure them.
(Italics ours.) State v. La Porte, at 822. The State's comments introduced to the jury the extraneous matter of accomplice liability, which was not before the jury. Only burglary was charged and the jury was instructed only on burglary. The State's comment was an incorrect statement of the law of the case and not in harmony with submitted instructions. See State v. Jacobsen, 74 Wn.2d 36, 442 P.2d 629 (1968). Accordingly, the State's response exceeded proper rebuttal and, therefore, was not invited.

II
The Court of Appeals held that while the State's conduct was improper and may have been prejudicial, under the circumstances the error was harmless beyond a reasonable doubt. We do not agree. In deference to that court, we point out that its decision in this case was rendered before our decision was announced in State v. Weber, 99 Wn.2d 158, 659 P.2d 1102 (1983).
[2] Weber pointed out that in cases involving only trial irregularities[1] the harmless error analysis is not appropriate. *762 The trial irregularity in this case involves prosecutorial misconduct. Prosecutorial misconduct may deprive the defendant of a fair trial and only a fair trial is a constitutional trial. State v. Charlton, 90 Wn.2d 657, 665, 585 P.2d 142 (1978). In cases of prosecutorial misconduct, the touchstone of due process analysis is the fairness of the trial, i.e., did the misconduct prejudice the jury thereby denying the defendant a fair trial guaranteed by the due process clause? Smith v. Phillips, 455 U.S. 209, 71 L.Ed.2d 78, 102 S.Ct. 940 (1982); State v. Weber, supra. Thus the legal error, if it exists, exists in the fact that petitioner's trial was unfair. Weber, at 169. Therefore, the ultimate inquiry is not whether the error was harmless or not harmless but rather did the impropriety violate the petitioner's due process rights to a fair trial.
We have stated on other occasions, a case will not be reversed for improper argument of law by counsel unless such error is prejudicial to the accused, State v. Estill, supra at 200, and only those errors which may have affected the outcome of the trial are prejudicial. State v. Gilcrist, 91 Wn.2d 603, 612, 590 P.2d 809 (1979). Errors that deny a defendant a fair trial are per se prejudicial. To determine whether the trial was fair, the court should look to the trial irregularity and determine whether it may have influenced the jury. In doing so, the court should consider whether the irregularity could be cured by instructing the jury to disregard the remark. Weber, at 165. Therefore, in examining the entire record, the question to be resolved is whether there is a substantial likelihood that the prosecutor's misconduct affected the jury verdict, thereby denying *763 the defendant a fair trial. State v. Wheeler, 95 Wn.2d 799, 807, 631 P.2d 376 (1981); State v. Charlton, supra; State v. Music, 79 Wn.2d 699, 489 P.2d 159 (1971), vacated, 408 U.S. 940 (1972); State v. Martin, 73 Wn.2d 616, 440 P.2d 429 (1968), cert. denied, 393 U.S. 1081 (1969).
After examining the entire record, we believe that the jury may have been affected by the State's misconduct and, therefore, the petitioner was denied a fair trial. First, the misconduct by the State is of a very serious nature. The defendant was charged with burglary and the jury received instruction only on the crime of burglary. The prosecutor, through improper closing argument, unilaterally presented the theory of accomplice liability to the jury.
We realize that attorneys, in the heat of a trial, are apt to become a little over-enthusiastic in their remembrance of the testimony. However, they have no right to mislead the jury. This is especially true of a prosecutor, who is a quasi-judicial officer whose duty it is to see that a defendant in a criminal prosecution is given a fair trial.
(Italics ours.) State v. Reeder, 46 Wn.2d 888, 892, 285 P.2d 884 (1955); see also State v. Case, 49 Wn.2d 66, 298 P.2d 500 (1956); State v. Huson, 73 Wn.2d 660, 440 P.2d 192, cert. denied, 393 U.S. 1096 (1968). The prosecuting attorney misstating the law of the case to the jury is a serious irregularity having the grave potential to mislead the jury.
[3] Respondent argues and the Court of Appeals adopted the position that the instructions given the jury cured any potential prejudice.[2] While a jury is presumed to follow the instruction of the court, State v. Grisby, 97 Wn.2d 493, 499, 647 P.2d 6 (1982), the record rebuts this presumption in this case. As we stated in State v. Cerny, 78 Wn.2d 845, 480 P.2d 199 (1971), vacated, 408 U.S. 939 (1972), "[w]e must presume, absent any contrary showing, *764 that the jury followed the court's instruction." (Italics ours.) Cerny, at 850. In this case a contrary showing has been made.
The record clearly supports the conclusion that the jury had considered the improper statement during its deliberation. Petitioner's timely and specific objection to the State's comment was overruled by the trial court. This ruling lent an aura of legitimacy to what was otherwise improper argument. After retiring and deliberating for over 2 1/2 hours the jury requested a definition of accomplice, i.e., can he be an outside participant? This inquiry establishes not only that during deliberations the jury was considering the prosecutor's improper comment, but also, that the jury considered the statement to be a proper statement of law.
The potential for prejudice is exacerbated by the fact that the jury was allowed to go home and consider the petitioner's guilt, as a principal or accomplice, overnight. The trial court gave no guidance to the jury that it should not consider accomplice liability. It was only upon returning the following day that the jury was instructed to "rely on the law given in the Court's instructions to the jury." This could not fairly be called a curative instruction. At best, this instruction implicitly directed the jury not to consider accomplice liability but, nevertheless, failed to inform the jury that the State's comment was improper and not to be considered.
The State argues that any potential jury prejudice was not due to its misconduct. The State argued in its brief:
It is true that the jury appeared confused about the meaning and relevance of the word accomplice, a confusion that the trial court, properly, did not elaborate upon with further instruction. But this confusion cannot be attributed to the prosecutor. The prosecutor merely tried to correct the mistaken impression, imparted to the jury by defense counsel, that if the defendant was an accomplice to the burglary then he was innocent.
(Italics ours.) While it is not unconstitutional to charge a person as a principal and convict him as an accomplice, the *765 court must instruct the jury on accomplice liability. See State v. Carothers, 84 Wn.2d 256, 525 P.2d 731 (1974); State v. Frazier, 76 Wn.2d 373, 456 P.2d 352 (1969). In this case, the petitioner was not charged as an accomplice and, more importantly, the jury was not instructed on accomplice liability. The problem with the State's argument is self-evident from these facts. The petitioner was charged with second degree burglary. He could not constitutionally be convicted of that charge if the jury found he was an accomplice but never entered or remained unlawfully in the burglarized residence, because it was never instructed on accomplice liability. Therefore, any mistaken impression imparted to the jury was due to the improper conduct of the prosecutor in instructing the jury on accomplice liability.
The State concedes that no specific jury instruction was given to the jury, cf. State v. Weber, supra (court should consider effect of curative instruction) and the jury appeared confused by the State's comment. The record clearly establishes that the jury was influenced, if not misled, by the prosecutor's comment. Therefore, we are unable to say from the record whether the petitioner would or would not have been convicted, but for the improper comment. State v. Charlton, supra; State v. Music, supra; State v. Martin, supra.
In conclusion, we hold that the prosecutor's comments in rebuttal constituted improper argument amounting to a serious trial irregularity. The record clearly supports our holding that the jury considered the improper argument and may have been prejudiced by it. Therefore, we reverse the petitioner's conviction and remand for a new trial.
WILLIAMS, C.J., ROSELLINI, STAFFORD, UTTER, DOLLIVER, DORE, and PEARSON, JJ., and CUNNINGHAM, J. Pro Tem., concur.
NOTES
[1]  Trial irregularities are irregularities which occur during a criminal trial that only implicate the defendant's due process rights to a fair trial. Such irregularities neither independently violate a defendant's constitutional rights, as was done in State v. Evans, 96 Wn.2d 1, 633 P.2d 83 (1981) (improper comments on the defendant's right to remain silent) nor violate a statute or Rule of Evidence as in State v. Cunningham, 93 Wn.2d 823, 613 P.2d 1139 (1980) (introduction of tapes in violation of RCW 9.73.090(2)) and State v. Tharp, 96 Wn.2d 591, 637 P.2d 961 (1981) (introduction of evidence in violation of the Rules of Evidence). While the standards applicable to the latter situations are not the same, see State v. Evans, supra at 6 n. 1 (Brachtenbach, J., concurring); State v. Cunningham, supra at 831, all three cases are illustrative of the type of cases that involve the 2 step harmless error analysis.
[2]  At the close of the case the jury was given a general jury instruction to disregard statements of counsel in closing argument not supported by the law or evidence. The jurors were also instructed to abide by the law given in the instructions read to them when they reconvened the morning after they sent their note out requesting a definition of accomplice. Clerk's Papers, at 8.
