A teacher called a 13-year-old student his "seer", his "partner in crime", and told her he wanted to climb in her window.
The teacher, 42, is charged with serious misconduct for forming an inappropriate relationship with the girl, who has since died, and for failing to tell her parents, the school, or health professionals about her problems and about their relationship.
The lawyer for the Education Council's disciplinary tribunal, Dale La Hood, said the teacher's communications to the girl had encouraged an emotional attachment.
Mr La Hood said that in one letter the man had called the girl his "seer and true friend", "a confidante and partner in crime".
In other communications he said he missed her "five or sometimes six days a week" and that he "badly wanted" to climb in her window "right now".
The teacher, whose name is suppressed, told the tribunal he was trying to buoy up the girl who was troubled and sometimes ran away from home.
He said she had told him she would run away if he sought professional help for her or told his principal, and he was worried that she would come to harm.
The man was the girl's Year 8 teacher at an intermediate school. They began exchanging emails when the girl was working on a writing project in 2013.
In October that year, she had come to the house the teacher shared with his fiancee during a storm at night. She had threatened to run away if the couple contacted her parents and asked them not to tell anyone.
The man said they agreed to let her stay because they wanted her to be safe.
The girl stayed at their house on other occasions, including two times when the man's fiancee was not present.
He said he had wanted to help the girl and could not see a way to extricate himself from the situation. He said he had told her she should not come to his house and that their relationship was not appropriate for a teacher and student.
Mr La Hood said none of the man's written communications with the girl suggested she should not come to his house, or that the relationship was inappropriate.
The teacher said he had told her that in person.
Mr La Hood said the teacher had informed a social worker that the girl appeared to be harming herself and the girl had not reacted badly. He said that contradicted the man's fears the girl would run away if he told his principal or a health professional.
The man said the girl's reaction to that incident had been unusual.
His fiancee is also a teacher and has also been charged with serious misconduct.
The teachers' names and the names of their schools and the region they live in are suppressed.
The hearing is scheduled to continue on Friday.