"If I was not on the farm that morning, I would be one of the missing," Ezekiel Kitiku told the BBC from southern Israel.
Two of his compatriots - Joshua Loitu Mollel and Clemence Felix Mtenga - were among more than 230 people taken as hostages to the Gaza Strip, which is under the control of Hamas, proscribed as a terrorist group in the UK and other countries.
The three students had landed in Israel in September, excited to start their work as agricultural interns for the next 11 months.
Since their arrival, Ezekiel Kitiku and Mr Mtenga had been living on Kibbutz Nir Oz and working at a dairy farm in the afternoons. Their friend Mr Mollel was staying and working about 30km (18 miles) away at Kibbutz Nahal Oz. Both kibbutzes have a population of several hundred people and are very near Gaza.
"That week the new timetable was prepared and my name was mentioned to work on the nightshifts, but Clemence remained on afternoon shifts," Mr Kitiku told the BBC. Mr Mollel was on day shifts at a different farm.
At around 01:00 on 7 October, Mr Kitiku says he set off in the dark on his bike and rode five minutes to the farm to start his shift.
He spent the early hours of that morning milking cows and carrying out veterinary duties. By 06:00, as the sun started to rise, he was tending to cattle inside a shed.
Thirty minutes later he heard a huge explosion. This was when Hamas began to fire rockets from Gaza.
"When I heard the noise, I remembered that we had been told that if we hear the sound of shooting or bombs we should go to the shelter, so that's what I did.
"I was so scared. It was my first time to hear a noise like this."
As he headed to the shelter, he noticed thick smoke and orange flames billowing from near his kibbutz, so he immediately contacted both of his friends.
"They told me that there were so many rockets coming from Gaza - and that they were going to the shelters too."
Unknown to him, however, Hamas gunmen had already begun raiding the two kibbutzes where his friends were.
A couple of hours later, he noticed that his WhatsApp and text messages were no longer being delivered to their phones.
"I thought maybe their phones were out of charge. The last message I sent to them was - 'Are you safe?'"
Neither replied. This was at around 10:00. He has not heard from them since.
As rockets hammered down throughout the day, Mr Kitiku was forced to remain at the farm, trying to sleep inside the shelter.
The following morning when things seemed a little calmer and desperate to find out what had happened to his friends, he begged his manager to take him back to his kibbutz. There he could see that troops from the Israel Defense Forces (IDF) had been deployed.
"At the gate of the kibbutz there were so many IDF soldiers. They refused me entry and told me I would have to go back to stay at the farm because it was safer."
He remained in the shelter at the farm with two others for another two days - with barely any food - and another night on his own.
In the end the IDF said he would not be able to return to his kibbutz and soldiers escorted him to another location around 30km north of Gaza.
As he left the farm, he was shocked by what he saw outside the gates.
"The water systems had been bombed, and water was flowing everywhere. I saw dead bodies on the street.
"The fear of what had happened to my friends started to grow."
The three men had met in Tanzania's economic hub of Dar es Salaam through their agriculture studies a few months before they travelled to Israel.
It was not until three weeks after the Hamas attack that Mr Kitiku finally found out what had happened to his friends.
The Israeli foreign affairs ministry announced in a statement on Sunday that they were being held hostage in Gaza.
More on Israel-Gaza war
Follow live: Latest updates
From Gaza: Stories of those killed in Gaza
History behind the story: The Israel-Palestinian conflict
He says he is grateful to learn that they are both alive, but remains concerned about their conditions. He also knows other students on their programme who have been taken hostage, including one from Thailand.
In addition to those they took hostage, Hamas gunmen killed about 1,400 people on 7 October, many of whom were living on kibbutzes.
Since then, Israel has carried out air strikes on the Gaza Strip. The Hamas-run health ministry says some 9,000 people have been killed.
Mr Kitiku says he is extremely worried about the safety of his friends being held in the Gaza Strip.
"There is so much bombing and people have few social services. I try to put myself in their shoes, but I cannot imagine what they are going through."
He says the realisation of how close he came to being caught up in the attack lies heavy on his mind.
"The first few days, psychologically I was not stable. I am trying to force myself to cope with the situation.
"If I was not on the farm that morning, I would be one of the missing."
He is now working at a different farm.
"The authorities in Israel told us we are safe and we can continue our internship here," he says.
He and other Tanzanian students - there are an estimated 260 in Israel - have been offered assistance by their embassy to return home should they wish to, he says.
"But how can I think about going home when I don't know the situation and the condition of my two friends in Gaza?"