Alexander Coward, a young mathematics lecturer at the Berkeley campus of the University of California, shot to unlikely fame in 2013 when his impassioned paean to college learning leaked online and went viral.

The British academic had emailed 800 students to explain why he would continue teaching during a strike by university employees. Instead of being defensive, he was lyrical, exalting the students and their commitment to learning.

“Do not fall into the trap of thinking that you focusing on your education is a selfish thing. It’s not a selfish thing. It’s the most noble thing you could do,” Coward wrote, saying it was a privilege to teach such exceptional and amazing people.

“Society is investing in you so that you can help solve the many challenges we are going to face in the coming decades, from profound technological challenges to helping people with the age-old search for human happiness and meaning. That is why I am not canceling class tomorrow.”

The response was electric. Facebook, Twitter, Reddit and other platforms transmitted the email to a global audience, which responded largely with acclaim, though some faulted Coward for crossing the picket line. Almost a million hits crashed the website of the Berkeley alumnus magazine which reported the story.

Coward teaching at Berkeley University. Photograph: Courtesy of Coward

California seemed to have its own Mr Chips – the fictional, beloved British teacher immortalised in a novel, plays and films.

This week, however, the fairytale soured.

Coward announced he was being fired because the math department could not stomach his methods, popularity and success – and that he had suffered suicidal depression. “The temptation to speak publicly has been with me for a long time,” he told the Guardian in a telephone interview.

The 33-year-old alleged superiors bullied him and bristled at unconventional teaching techniques, even though they inspired learning. “I used to think it was about (their) egos, but in fact it’s about keeping control,” he said.

His announcement has triggered angst and anger on campus. More than 3,000 people have signed an online petition demanding the university keep Coward, calling him invaluable to students and the mathematics department. “There is absolutely no sense in firing him for being too good at his job.”

Almost 4,000 have promised to gather at Sproul Plaza and march on University Hall on 20 October, when Coward will lobby campus authorities to let him stay. “We’re blown away by the sheer amount of support that everyone has shown for Coward in the past 24 hours!” wrote one organiser. Coward said he will address the rally before entering the meeting.

The controversy is an unexpected twist to the rhapsody of two years ago. The academic who defied a strike has now enlisted his union in the official grievance he has filed against the University of California. And a flagship campus renowned as the intellectual home of counter-culture stands accused of vindictive hostility to innovation.

In a statement Janet Gilmore, a spokeswoman for UC Berkeley, said the law, policy and a collective bargaining agreement constrained it from discussing the specifics of any lecturer’s employment.

A campus renowned as the intellectual home of counter-culture stands accused of vindictive hostility to innovation

However she said there was nothing unusual about a contract not being renewed. “Many lecturers have appointments that may be for a single term or up to two years. They often fill in for regular faculty who are on leave, provide additional teaching to cover surges in enrollment, and teach large undergraduate classes. Lecturers do not receive a commitment for ongoing employment until they have taught for six years and have undergone a rigorous academic review of their teaching.”

Coward said he never expected to be mired in such a dispute. Originally from London, he obtained his D.Phil, a PhD equivalent, from Oxford (thesis title: “algorithmically detecting the bridge number of hyperbolic knots”) and went on to teach at Oxford’s St Catherine’s College, Vietnam’s Th ́ai Nguyˆen University, France’s European Innovation Academy and the University of California, Davis, before moving to Berkeley in July 2013.

Mathematicians are not famed for ebullience and many prefer research – deep, solitary labour – to the challenge of communicating complex abstractions to young adults. Coward, however, adores teaching. “There are so many confounding variables in education,” he said. “Counter-intuitive things. For example extrinsic rewards can undermine motivation.”

His enthusiasm bubbled in lectures, handwritten notes, impromptu problem-solving at the whiteboard and personalised emails and homework assignments which ignored textbook suggestions.

The result, he said, was student evaluations which were the highest on record in the mathematics department, ranging from 6.4 to 6.6 out of 7, versus a usual departmental average of 4.7. His students in the 2013 fall semester scored 0.17 grade points higher than those who studied under another teacher.

The viral email about the beauty, wonder and importance of learning seemed to cement his image as an educator in the mould of Robin Williams’s character in Dead Poets Society.

But behind the scenes, said Coward, the department seethed. It was dysfunctional – world class research co-existing with sub-standard teaching – and instead of embracing the Englishman’s success as a remedy the department considered it disruptive, he said.

“I was trying to share my methods. I was saying look, I know you find a lot of this counter-intuitive, but look at the results, 95% attendance in my class, 20% in yours. But people just didn’t want to listen.”

Coward claimed superiors had ordered him to be ‘more ordinary’. Photograph: Courtesy of Coward

Coward said the strain of working under scrutiny from his superiors “took its toll” and in May 2014 he was admitted to a psychiatric hospital for suicidal depression. Coward said he recovered, but that a few months later, in October, the then chair of the department, Arthur Ogus, said his employment would be terminated in June 2016.

Ogus and his successor Craig Evans, the interim chair of the Berkeley math department, said confidentiality rules prevented them speaking publicly about Coward’s case and referred queries to the university’s spokesperson.

The lecturer hoped in vain that Ogus’s successor, Craig Evans, would reverse the decision. In March this year he filed a formal grievance claiming incomplete documentation and procedural violations in the review process that led to his order of termination. Asked if it was ironic to be relying on his union after breaking the 2013 strike, he paused. “I don’t know. If there is it’s not coming up much.”

Coward went public this week by posting a 2,600-word post on his blog, detailing allegations such as superiors ordering him to be “more ordinary” and comparing him with a McDonald’s employee trying to experiment. It added up, he wrote, to a blunt warning: “Stop making us look bad. If you don’t, we’ll fire you.”

In her statement Gilmore, the spokeswoman, said student evaluations were not the sole basis for evaluating a lecturer’s performance. She defended the mathematics department as a bastion of teaching excellence, with lecturers, professors and instructors who were top in their fields.

“[It] is generally recognized as one of the broadest, liveliest, and most distinguished departments of mathematics in the world with approximately 55 regular faculty members representing most of the major fields of current research, along with 25 to 30 post-doctoral scholars, 180 graduate students, 500 undergraduate majors, one of the finest mathematics libraries in the nation.”

Authorities will discuss the grievance with Coward at the 20 October meeting, after which they will have 15 days to rule. The lecturer reckons he has a chance of being kept on. “I rate my chances as OK, though not great,” he told the Guardian.

If he is ousted he worries about finding another job. “By blowing the whistle you’re probably going to commit professional suicide. Even if you have some sympathy in the academic community what future hiring community will want to hire a whistle blower?”