In 1986, twenty days after termination of his employment as a correctional officer at the former Deer Island *817house of correction, Royden Lungelow, who is an African-American, filed a complaint with the Massachusetts Commission Against Discrimination (MCAD), alleging his discharge by the city of Boston2 (city) was racially motivated in violation of G. L. c. 151B, § 4(1),3 and 42 U.S.C. §§ 1983 et seq. (1994).
On October 28, 1986, Lungelow and two provisional correction officers, who were white, quelled a disturbance by manacling an inmate to his cell door. Initially, all three officers were discharged for the infraction. However, upon appeal to the penal commissioner, the two white officers were reinstated.
An evidentiary hearing was held in 1992 before Commissioner Michael Duffy (commissioner), the MCAD’s chairperson, who determined that the termination of Lungelow’s employment was, in fact, a violation of G. L. c. 15IB, § 4(1), and awarded him compensatory damages for back pay and emotional distress. Subsequently, he also ordered the city to reinstate Lungelow to his former position.
The city appealed from the decision of the commissioner to the full commission. The MCAD, on February 16, 1996, concluded that the city’s disparate treatment of Lungelow was an unlawful practice under G. L. c. 15IB, § 4(1), and affirmed the award of damages. However, the MCAD ruled that because of events that transpired while his claim was pending, Lunge-low had become unqualified to serve as a correctional officer. It reversed the commissioner’s reinstatement order and also vacated the award of interest on the damages. See Boston v. Massachusetts Commn. Against Discrimination, 39 Mass. App. Ct. 234, 245 (1995).
*818The city brought a complaint in Superior Court, seeking judicial review of the MCAD decision. G. L. c. 15IB, § 6. G. L. c. 30A, § 14(7). On June 10, 1997, a Superior Court judge allowed the city’s motion for judgment on the pleadings.4 He adopted the city’s position stating that “Lungelow never filed a complaint alleging discrimination in refusing to rehire him and the original complaint was never amended to assert that claim.” The judge ordered so much of the MCAD’s decision in favor of Lungelow be annulled. Both Lungelow and the MCAD appealed.
1. Dismissal of the complaint. Initially, our review focuses upon the judge’s ruling dismissing Lungelow’s complaint as matter of law. To place this issue in proper context, we cull the uncontested material from the record of the proceedings below.
The essential allegations of Lungelow’s complaint were typed on a form made available by the MCAD. See 804 Code Mass. Regs. § 1.03(3), (4) (1978). It contained, among other things, the following information: his name, address and telephone number; the name and address of his employer; and a box for him to check off the nature of the discrimination and date of his termination. In a space provided on the form, Lungelow also described the particulars of the discrimination as his belief “that I have been terminated on account of my (r)ace and (c)olor” and that “(t)o my knowledge, more black correctional officers are suspended and terminated at Deer Island . . . than white correctional officers.” The complaint was signed and filed by Lungelow on November 17, 1986.
It appears that shortly after his discharge and before he filed his complaint, Lungelow found out that the two other correctional officers, James Wise and Steven Acone, both involved in the handcuffing incident and terminated along with him, had been rehired after speaking with the penal commissioner, Robert Walsh. What precipitated Lungelow’s MCAD complaint was his telephone conversation with Walsh during which he asked for the same reconsideration. The hearing commissioner, who credited Lungelow’s testimony on the point, found that “[the penal commissioner] laughed at his request and hung up.”
*819The judge granted the dismissal of the complaint on the basis of a procedural error not argued by the MCAD at the adjudicatory hearings, that is, the failure of Lungelow or the MCAD to include the rehiring issue on the form or to amend the complaint before or during the hearings.5 He reasoned that although both claims are based on racial discrimination, they are predicated on two separate acts of the employer.
We start with the proposition that, absent extraordinary circumstances, the failure of a party to present issues to MCAD which could have been raised precludes the party from arguing the issue on appeal. Massachusetts Elec. Co. v. Massachusetts Commn. Against Discrimination, 375 Mass. 160, 172 (1978), and cases cited. This proscription holds true even if the party is presenting constitutional claims or defenses. New York & Mass. Motor Serv., Inc. v. Massachusetts Commn. Against Discrimination, 401 Mass. 566, 579-580 (1988). Here, the city did not raise any claims of procedural irregularity during the prolonged period during which the case was before the MCAD although it had several opportunities to do so. See Katz v. Massachusetts Commn. Against Discrimination, 365 Mass. 357, 364 (1974); Boston v. Massachusetts Commn. Against Discrimination, 39 Mass. App. Ct. at 242.
There is another reason why we conclude that the judge was incorrect in allowing the city’s motion to dismiss. In this kind of case, where the employee proceeds, at least initially, without counsel, “the administrative charge is liberally construed in order to afford the complainant the benefit of any reasonable doubt.” Lattimore v. Polaroid Corp., 99 F.3d 456, 464 (1st Cir. 1996).6 The policy expressed in Reilly v. Massachusetts Bay Transp. Authy., 32 Mass. App. Ct. 410, 414-415 (1992), dictates that, “[ejven where the issues raised are not within the scope of *820the pleadings, a judge, in the absence of prejudice . . . , is encouraged by the Massachusetts Rules of Civil Procedure freely to allow amendments.” Here the evidence could reasonably be viewed as within the matters pleaded. There is no question that the city had adequate notice of the disparate discipline claim Lungelow generally alleged in the complaint; the city knew, from the probable cause finding, that its refusal to rehire him was an integral part of the claim. In February, 1988, the city received a copy of the MCAD’s probable cause finding which reads in part,
“There is sufficient evidence upon which a [f]act-[f]inder could form a reasonable belief that [respondent terminated [cjomplainant and did not rehire him on account of his [r]ace and [cjolor ([bjlack) in violation of the law.”
Then again, the record shows that the city was put on notice of the issue when corporation counsel for the city made an opening statement at the evidentiary hearing before the single commissioner in which he said that the complaint had not been amended, but did not request, as he could have, additional time to address the rehiring issue. Without objection, he agreed to present the city’s full defense. We may look to the Massachusetts Rules of Civil Procedure for guidance. See Reilly v. Massachusetts Bay Transp. Authy., supra. Rule 15(b), 365 Mass. 761 (1974), provides: “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.”
Nor is there any merit to the city’s argument that there was prejudice because it could not present evidence in defense of the claim. See Langlitz v. Board of Registration of Chiropractors, 396 Mass. 374, 377-378 (1985) (failure of party to request continuance or other relief defeats the claim of unfair surprise). We note that MCAD’s counsel filed a joint prehearing memorandum that discussed Lungelow’s disparate treatment arising from the city’s refusal to rehire him. For these reasons, we are of opinion that lack of precision in the drafting of the MCAD complaint, in the absence of circumstances which are identifiably more extraordinary than those now before us, may *821not be used to dismiss the complaint.
2. Substantial evidence of unlawful discrimination. We turn to the question whether there was substantial evidence to support the MCAD’s conclusion that the city would not have discharged Lungelow except for his race. Discrimination based on disparate treatment may be proven through direct or circumstantial evidence. See Smith College v. Massachusetts Commn. Against Discrimination, 376 Mass. 221, 228 (1978).7
As direct evidence of racially discriminatory intent is rarely available, disparate treatment may be shown by using the burden shifting principles first set forth in McDonnell Douglas Corp. v. Green, 411 U.S. 792, 802-805 (1973).8 To establish a prima facie case, the plaintiff first shows that he or she is in the protected class and is qualified to perform the task at issue, but was nonetheless subjected to an adverse employment decision. Blare v. Husky Injection Molding Sys. Boston, Inc., 419 Mass. 437, 440-441 (1995). Then, in the next stage, the burden of production shifts to the employer to articulate a nondiscriminatory reason for the discharge, supported by credible evidence. Id. at 441-442. In the event that occurs, as in this case, the burden then shifts back to the plaintiff to establish that the reason offered by the employer is not the real reason, but is in fact a pretext.9 Smith College v. Massachusetts Commn. Against Discrimination, 376 Mass, at 230. Throughout this three-stage analysis, the burden of proof — as opposed to the burden of production — remains with the plaintiff. Wheelock College v. Massachusetts Commn. Against Discrimination, 371 Mass. 130, 139 (1976).
No case of disparate treatment under G. L. c. 15 IB is *822complete without proof that the plaintiff’s termination was a pretext for racial discrimination by showing that similarly situated employees were treated differently. See Smith College v. Massachusetts Commn. Against Discrimination, 376 Mass, at 228; Matthews v. Ocean Spray Cranberries, Inc., 426 Mass. 122, 128, 129 (1997). See also Wooster v. Abdow Corp., 46 Mass. App. Ct. 665, 671-672 (1999). The cases just cited all recognize that an “arbitrary or unwise” employment decision that is not based on discriminatory factors warrants no relief under c. 15IB.
Viewed against this background, we observe that Lungelow established a prima facie case against the city by showing that the decision not to rehire him was racially based. The city’s first defense, developed during the course of the MCAD hearings, was that there was evidence of other similar inadequate job performance on Lungelow’s past record. However, the record shows only a single attempt to discipline him because of a 1986 failed escape incident. That complaint was thrown out upon proof that an officer who had been working the same shift as Lungelow at the time was, in fact, the responsible employee. We note that the city, itself, thought him qualified to perform the work by keeping him on the roster in the same position without any further conditions attached to his employment. See Flowers v. Crouch-Walker Corp., 552 F.2d 1277, 1283 (7th Cir. 1977) (“[an] employer’s acceptance of [an employee’s] work without express reservation” implies that the employee was qualified).
Second, the city contended that, as a permanent employee, Lungelow was not performing the same tasks as the two white provisional officers and bore a greater responsibility for what occurred. We cannot say that the MCAD erred in rejecting this position, taking instead the view that similarly situated employees, for purposes of disparate treatment analysis, need not hold identical job descriptions or tenure. What counted, in the MCAD’s view, was the “actual job performance and content — not job titles, classifications or descriptions.” Equal Employment Opportunity Commn. v. Sears, Roebuck & Co., 839 F.2d 302, 344 (7th Cir. 1988). Testimony from a supervisory official at the jail, Deputy Superintendent Ronald J. Murray, credited by Commissioner Duffy, supported his finding that all three of the correctional officers were closely aligned in function and that the penal department’s personnel manual did not distinguish *823between officers of different seniority or outline different standards of performance for permanent and provisional employees.
Closely allied to this defense was the city’s assertion that Lungelow took the lead in handcuffing the prisoner to his cell door. A report, prepared within days of the infraction by Lieutenant Fogg, contradicted the city’s position. He found that all three “bear responsibility for this act.” He expressed disbelief that “other supervisors on duty at the time, did not hear anything about this incident.” His assessment did not distinguish between the officers in terms of individual culpability. While this evidence did not compel a finding that, in relation to Wise and Acone, Lungelow had been unfairly targeted, it was sufficient to support a rational finding by the MCAD to that effect.
In short, the evidence of pretext was strong and the record below contained substantial evidence that Lungelow satisfied his burden. As a reviewing court, we are not “empowered to determine the facts anew, or to judge credibility, or to draw different inferences from the facts found by the commission.” Gnerre v. Massachusetts Commn. Against Discrimination, 402 Mass. 502, 509 (1988). The circumstances of this case are not unfamiliar.10 Under the commission findings, the penal department, by refusing to rehire Lungelow, violated G. L. c. 15IB. In wielding the power to sanction Lungelow for his mistakes in this incident, which did not involve an actual escape or major disruption to the institution, the city had a duty to treat him fairly. The record below contains substantial evidence that the city failed in this respect.
3. Failure to permit testimony of counsel. Trial counsel for the city, after completing his direct examination of the city’s final witness, asked Commissioner Duffy if he could testify because he wanted to tell “what [he] kn[e]w about the appointing authority’s reasons for rehiring Mr. Acone and Mr. Wise.” Commissioner Duffy decided not to permit counsel to testify, and the city raises the point on appeal. There is no absolute law preventing an attorney from testifying on behalf of a client. See Kendall v. Atkins, 374 Mass. 320, 323-324 (1978). But see Supreme Judicial Court Rule 3:07, Canon 5, DR 5-102(A), as appearing in 382 Mass. 780 (1981) (except in specified *824circumstances, no testimony by a lawyer who ought to be a witness for his client unless he and his firm withdraw for representation and conduct of the proceeding). It is permitted in “rare” situations where it does not appear that other sources are available to testify on the issues; but in such situations, substitute counsel should be obtained “well in advance of trial.” Black v. Black, 376 Mass. 929, 929 (1978). See Supreme Judicial Court Rule 3:07, Canon 5, DR 5-101(B), as appearing in 382 Mass. 779 (1981). Apart, therefore, from the reality that trial counsel did not say that he had firsthand knowledge of why the two white officers were rehired, Commissioner Duffy did not abuse his discretion in excluding the city’s trial counsel’s belated request. Compare Commonwealth v. Pyne, 35 Mass. App. Ct. 36, 39-40 (1993).
4. Conclusion. As Lungelow does not contest the MCAD’s refusal to reinstate him to his former position as a correctional officer, apparently on grounds that he no longer qualifies, we need not address that issue. The MCAD did award back pay from the date of his termination to February 16, 1996, when its decision was filed. Accordingly, the judgment of the Superior Court must be reversed, and a new judgment is to be entered affirming the decision of the MCAD.
So ordered.
While the complaint was pending before the MCAD, by St. 1991, c. 138, §§ 356-363, the Legislature transferred control and authority to operate the Suffolk County house of correction from the city of Boston’s penal institutions department to the sheriff of Suffolk County.
General Laws, c. 151B, § 4(1), as in effect prior to St. 1989, c. 516, § 4, reads as follows:
“It shall be an unlawful practice:
“1. For an employer, by himself or his agent, because of the race, color, religious creed, national origin, sex, or ancestry of any individual, to refuse to hire or employ or to bar or to discharge from employment such individual or to discriminate against such individual in compensation or in terms, conditions or privileges of employment, unless based upon a bona fide occupation^ qualification.”
Though the motion before the trial court judge was labeled a motion on the pleadings, that document also included all the city’s grounds for appeal of the MCAD’s decision. The parties have fully briefed all the issues raised, and being in as good a position as the trial court to review the administrative record, we address all aspects of the city’s appeal. See Director of the Div. of Employment Security v. Mattapoisett, 392 Mass. 858, 862 n.5 (1984).
Authorization for amendment of MCAD complaints is found in 804 Code Mass. Regs. § 1.03(5) (1978). As relevant, that section reads:
“(a) A complaint or any part thereof may be amended ... to clarify and amplify allegations made therein. An amendment alleging additional acts constituting unlawful discriminatory practices related to or arising out of the subject matter of the original complaint may be permitted by leave of the Commissioner. Amendments shall relate back to the original filing date.”
The MCAD is allowed to relax the application of the regulations where necessary in the interests of justice. 804 Code Mass. Regs. § 1.01 (1986). A court should not reverse an agency decision unless the errors alleged have *820prejudiced the substantial rights of a party. See G. L. c. 30A, § 14(7); Solimeno v. State Racing Commn., 400 Mass. 397, 406 (1987). ,
Disparate treatment cases generally involve situations where an employer “purposefully uses race, color, religion, sex, or national origin as the determinative factor in employment decisions.” School Comm, of Braintree v. Massachusetts Commn. Against Discrimination, 377 Mass. 424, 428 (1979). “[Disparate impact] cases involve employment practices that are facially neutral in their treatment of different groups, but that in fact fall more harshly on one group than another.” Id. at 429.
For application of this analysis in Massachusetts cases, see, e.g., Wheelock College v. Massachusetts Commn. Against Discrimination, 371 Mass. 130, 138-139 (1976); Johanson v. NCR Comten, Inc., 30 Mass. App. Ct. 294, 296-301 (1991).
Because the commission found that the city’s articulated reason for not rehiring Lungelow was a pretext for racial discrimination, we do not dwell on whether Massachusetts applies a pretext only standard.
In Boston v. Massachusetts Commn. Against Discrimination, 39 Mass. App. Ct. 234 (1995), the Boston penal department was found liable for race discrimination in a case strikingly similar to the complaint Lungelow filed with the commission.