
80 Ill. App.3d 94 (1980)
398 N.E.2d 1246
JODY EVERSOLE, Plaintiff-Appellant,
v.
NELSON WASSON, Defendant.  (VILLA GROVE SCHOOL DISTRICT NO. 302, Defendant-Appellee.)
No. 15571.
Illinois Appellate Court  Fourth District.
Opinion filed January 8, 1980.
Rehearing denied January 30, 1980.
*95 Lawrence E. Johnson & Associates, of Champaign, for appellant.
T.G. Knappenberger, Jr., of Champaign, and William F. Tracy II, of Monticello, for appellee Villa Grove School District.
Affirmed in part; reversed and remanded in part.
Mr. JUSTICE GREEN delivered the opinion of the court:
On November 29, 1978, plaintiff Jody Eversole filed suit in the circuit court of Douglas County seeking compensatory and punitive damages against defendants Nelson Wasson and Villa Grove School District No. 302. The complaint concerned an alleged assault and battery committed on November 1, 1978, by defendant Wasson, a teacher for the defendant school district against plaintiff, who was a high school pupil of that district. Count I was against defendant Wasson and count II against the district. On April 19, 1979, the trial court allowed a defense motion to strike both counts, granting plaintiff leave to replead count I against the individual defendant but entering judgment in bar of action against the school district. Plaintiff appeals the judgment as to that count. We have jurisdiction because of the trial court's finding pursuant to Supreme Court Rule 304(a) (73 Ill.2d R. 304(a).)
Plaintiff maintains that count II was sufficient or, in the alternative, he should have been permitted to replead.
The following allegations of count I, directed against defendant Wasson, were incorporated in count II against the school district: (1) plaintiff was a student at Villa Grove High School which was controlled and administered by the defendant school district, (2) defendant Wasson was employed by the school district as a teacher at the high school, (3) on November 1, 1978, at approximately 12:30 p.m., Wasson was at the high school in his regular capacity as a teacher and plaintiff was attending a regularly scheduled class, (4) Wasson sought and received permission *96 from another teacher to take plaintiff from that teacher's class and talk to him in the hallway, (5) once in the hallway, Wasson accused plaintiff of being one of several students he believed had smashed Wasson's Halloween pumpkin at Wasson's home, (6) without provocation from plaintiff, Wasson berated plaintiff, called him vile names, and threatened him with physical violence while shaking his fist in plaintiff's face which placed plaintiff in fear of bodily injury, (7) Wasson then struck plaintiff about the head and face with both an open hand and a closed fist and shook and shoved him violently, (8) as a result, plaintiff was bruised about the head, neck, and shoulders; experienced pain and suffering in his head, body, and limbs; and became emotionally distraught causing his school performance and participation to be adversely affected, (9) defendant's actions were intentional, taken with a wilful disregard for plaintiff, his emotional and physical well-being, without just cause, and constituted wilful and wanton misconduct.
Count II also alleged (1) at all times involved, the school district had primary control and authority over the high school and teachers including Wasson, acting in loco parentis to plaintiff, (2) the school district had a duty to exercise reasonable care for plaintiff's safety, including a duty to select competent, experienced and careful persons to act on its behalf, (3) the school district violated its duties by permitting the above actions of Wasson toward plaintiff, and (4) plaintiff sustained the above mentioned injuries as a result of the school district permitting or failing to restrain Wasson's actions.
 1 Plaintiff's theory of count II was that the school district was vicariously liable for the alleged torts of defendant Wasson on a master-servant basis. Without Wasson being liable for his actions, the school district would not be liable. The parties agree that because a teacher stands in loco parentis to students (Ill. Rev. Stat. 1977, ch. 122, pars. 24-24, 34-8a), in order to state a cause of action against a teacher for injuries tortiously inflicted on a student, the complaint must allege the conduct to have been wilful and wanton. (Kobylanski v. Chicago Board of Education (1976), 63 Ill.2d 165, 347 N.E.2d 705.) Count II contained sufficient allegations that Wasson's conduct was wilful and wanton.
 2, 3 The complaint alleged that Wasson confronted plaintiff on school grounds during school hours and after having received permission from another teacher to talk to plaintiff. The purposes of the conversation, however, were personal to Wasson and did not concern plaintiff's school work or activities nor his conduct at school. Ordinarily when a servant commits an intentional tort concerning a matter personal to him, the tort is deemed to have been committed outside of the servant's employment though done during working hours and on the master's premises. However, when, under those circumstances, the master has a relation to *97 the victim that requires the master to protect the victim, vicarious liability nevertheless ensues. (Prosser, Torts § 70 (4th ed. 1971).) Here the plaintiff was in attendance at school and subject to the school's statutorily imposed control over him, allegedly directed to talk to Wasson. We deem the complaint to set forth a special relationship between plaintiff and the school district requiring it to protect him. The allegation of count II stated a liability of the defendant school district for any liability of defendant Wasson.
 4 Where a cause of action is based upon wilful and wanton conduct, a plaintiff seeking to recover must allege freedom from wilful and wanton conduct. (Prater v. Buell (1949), 336 Ill. App. 533, 84 N.E.2d 676.) Both counts failed to do that here and were properly dismissed for that reason here.
 5, 6 Ordinarily a plaintiff whose complaint is dismissed for failure to state a cause of action can complain of a judgment being entered in bar of action without leave to replead only if it seeks and is denied leave to replead. (Lee v. Conroy (1973), 13 Ill. App.3d 694, 300 N.E.2d 505.) Here, however, it is apparent that the trial court granted leave to replead as to count I despite its infirmity because a cause of action could have been stated by an allegation of freedom from wilful and wanton conduct but entered a judgment as to count II because it thought that no vicarious liability could arise against the school district from the facts alleged and thus concluded that no cause of action could be stated against that district. If this was correct, plaintiff would not have been entitled to replead. (Lee.) Because of the ruling, plaintiff undoubtedly concluded that attempt to replead would have been useless. Had the trial court anticipated our holding on the question of vicarious liability, we are persuaded that it would have likewise sua sponte permitted plaintiff to replead to count II.
Accordingly, we affirm the portion of the order dismissing count II but reverse the portion entering judgment in bar of action. We remand with directions to allow plaintiff to replead to count II.
Affirmed in part; reversed in part; remanded with directions.
MILLS, P.J., and CRAVEN, J., concur.
