
416 A.2d 669 (1980)
Paul E. DUQUETTE
v.
James J. GODBOUT and Richard Roe.
No. 78-27-Appeal.
Supreme Court of Rhode Island.
July 1, 1980.
*670 Aram K. Berberian, Warwick, for plaintiff.
William J. Toohey, City Sol., Thomas L. McDonald, Asst. City Sol., Warwick, for defendants.

OPINION
DORIS, Justice.
This plaintiff seeks reversal of a judgment entered for the defendants in the Superior Court after a jury-waived trial of his trespass action.
The plaintiff commenced suit after defendants forcibly entered his apartment in Warwick. The complaint alleged that defendants broke into and entered plaintiff's apartment, damaged the entrance, and rifled plaintiff's belongings. The defendants denied the fact of entry but did not assert any affirmative defense in the alternative.
At trial, defendant James Godbout testified on direct examination that he forcibly entered plaintiff's apartment. The defendant subsequently offered evidence that tended to establish a defense of justifiable entry. The plaintiff citing Rule 8(c) of the Superior Court Rules of Civil Procedure objected to the evidence, asserting that justification constitutes an affirmative defense that must be pleaded specially. The trial justice received the evidence over plaintiff's objection. The justice determined that the entry was justified and found for defendants.
On appeal, plaintiff contends that defendants' failure to plead justification waives it as a defense. He maintains justification was not at issue in the case, precluding the court's consideration of it. After examination of Super.R.Civ.P. 8(c) and 15(b), we agree.
Prior to the enactment of Rule 8(c), we determined that a plea of justification in actions of trespass cannot be proven under a general denial. Tessier v. LaNois, 97 R.I. 414, 198 A.2d 142 (1964). "A plea of justification is a plea in confession and avoidance, and `[i]t must meet and justify the cause of action stated in the declaration.'" Ahern v. Lynch, 99 R.I. 316, 318, 207 A.2d 296, 297 (1965) (quoting Wright v. Union R.R. Co., 21 R.I. 554, 555, 45 A. 548, 548 (1900)).
Rule 8(c) carries forward these prior holdings into modern practice. The rule states "a party shall set forth affirmatively * * * any * * * matter constituting an avoidance or affirmative defense." This is a mandatory provision; failure to plead an affirmative defense results in its waiver. Jakobsen v. Massachusetts Port Authority, 520 F.2d 810, 813 (1st Cir.1975); 1 Kent, R.I.Civ.Prac. § 8.6 at 87 (1969). Special pleading of affirmative defenses protects the complaining party from unfair surprise at trial. Gaines W. Harrison & Sons, Inc. v. J.I. Case Co., 180 F. Supp. 243, 247 (E.D.S.C. 1960).
The plea of justification clearly constitutes an affirmative defense to an action of trespass. A general denial disputes *671 the fact of entry, whereas a plea of justification admits the trespass, but avoids liability therefor. Thus, defendants waived the defense of justification unless properly raised.
After examining the record, we find that defendants did not formally raise the defense of justification. The defendants implicitly rely on the provisions of Rule 15(b) which direct the trial court to treat issues "tried by express or implied consent" as if raised in the pleadings.[1] We shall not disturb judgment below if plaintiff implicitly consented to trial of the defense. Fram Corporation v. Davis, R.I., 401 A.2d 1269, 1274 (1979); Kenney v. Providence Gas Co., 118 R.I. 134, 141, 372 A.2d 510, 513 (1977).
The defendants point to two portions of the transcript in support of their implied-consent theory. They assert that plaintiff's counsel did not object to certain testimony tending to establish justification. They also claim that plaintiff's own testimony raised the issue.
Our review of the transcript reveals that plaintiff did not consent to trial of the justification defense. Throughout the trial, plaintiff's counsel vigorously opposed introduction of evidence relevant to justification. The justice effectively foreclosed objections to such evidence in his initial ruling. He deferred plaintiff's legal argument to an "appropriate time." He subsequently overruled plaintiff's objections to "this line of questioning."
Rule 15(b) does not require an objecting party to be vigilant constantly for references to an unpleaded issue. We have held in prior cases that a party consents to trial of unpleaded issues if he does not interpose any objection. Fram Corporation v. Davis, R.I., 401 A.2d 1269 (1979); Halpert v. Rosenthal, 107 R.I. 406, 267 A.2d 730 (1970); Cofone v. Narragansett Racing Association, 103 R.I. 345, 237 A.2d 717 (1968). However, we did not intend that a party must object to every reference to an unpleaded issue. We find that plaintiff's counsel effectively voiced his objection to the justification issue. Counsel's failure to renew his objection at each reference to justification does not signify consent under Rule 15(b).
The defendants also assert that plaintiff raised the issue of justification in his own testimony. We are not persuaded by their contention. The plaintiff testified to the identity of the police officers who entered his apartment. In his identification of defendant Godbout, plaintiff summarized his discussion with defendant. Although plaintiff's testimony implicitly suggested the issue of justification, we shall not, without more, infer his consent to try the issue. We stated in Kenney v. Providence Gas Co., 118 R.I. at 141, 372 A.2d at 513-14:
"Despite the broad remedial purpose of Rule 15(b), implied consent to the trial of an unpleaded issue is not established merely because evidence which is relevant to an issue expressly embraced by the pleading will also inferentially suggest the unpleaded issue. There can be no implied consent under Rule 15(b) unless the parties clearly understand that the evidence in question is aimed at the unpleaded issue."
Guided by this standard, we find that plaintiff offered his testimony solely as evidence *672 of defendant's identity; it was not addressed to the unpleaded defense, which plaintiff clearly had no interest in raising.
The latter portion of Rule 15(b) governs when "evidence is objected to at trial on the ground that it is not within the issues made by the pleadings * * *." The rule provides, "the court may allow the pleadings to be amended and shall do so freely when the presentation of the merits of the action will be subserved thereby * * *." The rule contemplates rejection of evidence outside the scope of the pleadings but mandates liberal allowance of amendments to conform pleadings to the evidence offered. We held in Kenney v. Providence Gas Co., 118 R.I. at 142, 372 A.2d at 514, "[a]bsent a showing of extreme prejudice, a trial justice should permit the proposed amendment and allow the evidence. To do otherwise may constitute an abuse of discretion warranting reversal."
The trial record plainly indicates that defendants never intended to deny the fact of entry. The defendant Godbout admitted the entry in his answer to the second question posed on direct examination. The defendants relied entirely on the defense of justification.
The plaintiff's counsel promptly objected to evidence offered on this issue. At that point, the trial justice should have invoked Rule 15(b) and directed defendants to amend their pleadings. Once defendants offered to amend, plaintiff would have to "satisfy the court that the admission of such evidence [beyond the scope of the pleadings] would prejudice him in maintaining his action * * * upon the merits." Super.R.Civ.P. 15(b).
Unfortunately, the trial justice did not follow the procedure prescribed by Rule 15(b). He received evidence of justification over plaintiff's objection. He subsequently asked defendants' counsel whether justification was at issue. The defendants' counsel replied, "I don't know if it is or not. * * Would you like the matter briefed as to justification?" The justice declined the offer and proceeded to judgment. He found that defendants entered the apartment as alleged, but he determined they were not liable because the entry was justified.
In effect, the trial justice amended the pleadings sua sponte to include the issue of justification. The record indicates that he acted without considering possible prejudice to plaintiff. He thereby deprived plaintiff of the protection provided by Rule 15(b). Although plaintiff's burden is a heavy one, he is entitled to show extreme prejudice prior to an amendment of the pleadings. Kenney v. Providence Gas Co., 118 R.I. at 142, 372 A.2d at 514.
Ordinarily, we would require plaintiff to allege prejudice on appeal. However, the controlling portion of Rule 15(b) was not addressed directly in the trial court or on appeal. We shall not penalize plaintiff for defendants' error that the trial court compounded.
We shall therefore vacate judgment and remand this matter to the Superior Court with leave to consider a motion by defendants to amend their answer to include the defense of justification. On remand, plaintiff may present evidence of prejudice consonant with our holding in Kenney. If plaintiff meets his burden under Rule 15(b), the trial court will not permit the amendment, nor will it consider evidence of justification in the record. If plaintiff does not sustain his burden, the court must receive defendants' amended answer.
Because of our decision above, we do not reach the plaintiff's other assignment of error.
The plaintiff's appeal is sustained, the judgment appealed from is vacated, and the case is remanded to Superior Court for further proceedings consistent with this opinion.
NOTES
[1]  Rule 15(b), of Super.R.Civ.P. provides as follows:

"(b) Amendments to Conform to the Evidence. When issues not raised by the pleadings are tried by express or implied consent of the parties, they shall be treated in all respects as if they had been raised in the pleadings. Such amendment of the pleadings as may be necessary to cause them to conform to the evidence and to raise these issues may be made upon motion of any party at any time, even after judgment; but failure so to amend does not affect the result of the trial of these issues. If evidence is objected to at the trial on the ground that it is not within the issues made by the pleadings, the court may allow the pleadings to be amended and shall do so freely when the presentation of the merits of the action will be subserved thereby and the objecting party fails to satisfy the court that the admission of such evidence would prejudice him in maintaining his action or defense upon the merits. The court may grant a continuance to enable the objecting party to meet such evidence."
