Ian Wark, aged 30, who taught at Largs Academy, had wanted his job back, but was struck off the register by the General Teaching Council for Scotland with effect from March this year, after its disciplinary subcommittee found him guilty of "relevant misconduct".
Now a Glasgow employment tribunal has ruled that Mr Wark was unfairly dismissed and has continued the case to decide on compensation. Its full written reasons are not yet available.
Mr Wark is entitled to apply to the GTC to have his name restored to the register. The purpose of this, a council spokesman said, is "to show that the person is now suitable to be on the register of teachers and is not an opportunity to rehear the original case".
The tribunal had heard how the 16-year-old girl's mother complained to the headteacher when she discovered her daughter was closely involved with Mr Wark. When challenged, Mr Wark told education officials: "I am ashamed of my unwise behaviour."
He was instructed not to see the girl again - but not, he claimed, officially in writing.
He was fired for engaging in an "inappropriate and furtive relationship"
with the same pupil nine months later. Her mother had seen some of the emails exchanged earlier between the two and realised the relationship was much more serious than first suspected.
Mr Wark said he had only contacted her twice since being instructed not to, to warn her that his former girlfriend might be after her and that journalists were asking questions.
One email from the pupil to a friend said: "I think we are pretty much going to get together but nobody can know about it. If we were caught, he would probably lose his job as it would be seen as him abusing his position."
There were also references to dreams they had told each other about and the email continues: "What do you think I should do? He is 28 and is my English teacher."
The council said that, by contacting the pupil again, Mr Wark had undermined his professional standing as a teacher. He had also breached categorical assurances not to have any further contact with her after school hours.
John Travers, North Ayrshire's director of education, said: "The pattern of the relationship which had been described was well beyond the bounds of what would be expected of a teacher and a pupil in his charge.
"We had been given a picture of a steadily escalating relationship between Ian Wark and the pupil which had moved from exchanging email addresses and mobile phone numbers to daily contact in language which was unprofessional and inappropriate for communications between a teacher and pupil.
"It progressed to the position they were having secret meetings, exchanging gifts and she was visiting his flat for several hours into the early hours of the morning."
Mr Wark, from West Kilbride, Ayrshire, whose case was supported by his union, the Educational Institute of Scotland, said the relationship was purely platonic and there had never been any physical intimacy.
He told the tribunal it was an innocent friendship and they had met up to exchange Christmas presents, then gone back to his flat. He said he was happy to give a categorical assurance he would end the relationship and did so, but was later sacked after he sent her a text message to warn her about his ex-girlfriend, a former pupil at Largs Academy.
Mr Wark told the tribunal: "I acknowledge the fact that I should not have contacted her. I do not feel what I was doing was in any way, shape or form an attempt to rekindle our friendship. I was never given the instruction in any official written capacity."
Mr Wark agreed he also contacted the pupil again to warn her not to speak to the press.