The Gisborne teacher who sent thousands of texts to a teenager and let her stay at his home said the pair were friends and he was her "shoulder to cry on".
Sam Back said during the inquest into Reiha McLelland's death, the 13-year-old was "far from typical".
The inquest, in Gisborne, is a sequel to a Teachers' Disciplinary Tribunal, after which Sam Back was struck from the teachers' register and his partner Angie Mepham cautioned.
The McLelland family have blamed Back and Mepham's involvement with Reiha for her death in August 2014.
In his testimony this morning, Back said he met Reiha when she was a student in his class. She took to poetry, expressing a passion for it, so the teacher said he would help her with her writing.
She would email him, asking for his thoughts on poems and they would share other poetry they were each inspired by.
Questioned by the family's lawyer, Moira Macnab, in the hearing over whether sharing some of the poetry with dark, adult content was appropriate, Back said he wanted to progress her skills.
"There are 12- and 13-year-olds in your class who behave like they're 7 and there are 12- and 13-year-olds in your class who act like they're 20."
Macnab asked if he took into account her age - just 13.
"I took into account her writing age."
They continued to communicate through emails, then late one night in October 2013 Reiha showed up on the doorstep of the house he shared with Mepham "seeking shelter".
Back said it was pouring with rain, Reiha was soaked and visibly upset. He believed she had attempted to run away.
The couple said they would call her parents to come pick her up, but Reiha shook her head and said she'd "just leave".
Back said they asked her if there was anywhere else she could go, but she said no so they let her stay in the spare room but said they were both "incredibly uncomfortable".
The next day she sent him an email saying it was a stupid thing to do.
Over the term, the relationship between Reiha, Back and Mepham developed - he said she turned to him for support and having been through a similar situation during his own childhood, he looked at himself as well placed to help her.
Back said the teenager, whom he called "Reihaha" also threatened to run away if he told anyone, so he kept their communications and sleepovers from the school.
Reiha stayed over at their house in the spare room more often - sometimes while Mepham was away - and the former teacher and student chatted over texts and emails.
She asked him to just help her through until she went to Napier High School, at the end of the summer, and promised she'd be fine once she got there.
On January 2, 2014, Back said got a call from Reiha who was at Tolaga Bay with friends who'd been drinking asking what to do.
"By this point our relationship had gone beyond a student-teacher relationship despite my attempts to keep it that way. Reiha and I had much in common and many mutual interests. I could also relate, on a certain level, to what she may be feeling due to being through similar situations."
At the end of the holidays, Reiha went to Napier High School and got help but they continued to communicate. He wrote her a letter while he was on school camp.
At one point he wrote: "This is where our journey began."
The last time he saw her, Back held her hand in Gisborne Hospital, which worried the family.
At the end of his testimony, Back said: "Yes, she was a young girl, but she was far from typical.
"I was her teacher but we had become more like friends by the time she got to high school. I treated her like I would my little sister, like I would treat anyone. I provided safety and shelter when she sought it out. I answered her call when she reached out.
"When she wanted me to write her a letter I wrote one, when she wanted to Skype I did. And when she needed someone to listen, I listened. I was a shoulder to cry on, I was there."
The inquest continues.
• Lifeline: 0800 543 354 (available 24/7)
• Suicide Crisis Helpline: 0508 828 865 (0508 TAUTOKO) (available 24/7)
• Youthline: 0800 376 633
• Kidsline: 0800 543 754 (available 24/7)
• Whatsup: 0800 942 8787 (1pm to 11pm)
• Depression helpline: 0800 111 757 (available 24/7)
• Rainbow Youth: (09) 376 4155
• Samaritans 0800 726 666
• If it is an emergency and you feel like you or someone else is at risk, call 111.