Iman Aghabali sat down for a cup of coffee with his friend Mehdi Eshaghian before they boarded their plane for the flight back to Canada.

Aghabali grabbed his cell phone and captured the moment and sent it to a friend.

Then, both McMaster PhD students boarded Ukrainian International Airlines Flight PS752 that was set to take off from Tehran.

While Eshaghian sat in his chair, Aghabali took one more picture.

The photo shows Aghabali sitting on the plane, a pillow wrapped around his neck.

He was tired, but reportedly told his friends the plane was about to take off and he'd see them soon in Canada. It crashed minutes later, killing all 176 passengers and crew aboard.

McMaster University released a statement Wednesday afternoon saying it understood the two students were killed in the crash and expressed its sadness at the news.

Wednesday evening it confirmed a third victim with ties to the university. It said Siavash Maghsoudlou Estarabadi, who was listed on the flight manifest, spent a year as a postdoctoral fellow in the Faculty of Health Sciences and left the university in 2018.

I have no idea how he was dealing with those 30 seconds where he knew he was going to die. - Orod Kaveh, friend of Iman Aghabali

"It's killing me. It's just killing me," Orod Kaveh, a good friend of Aghabali, said of the photo.

"It's pretty devastating right now. I have no idea how he was dealing with those 30 seconds where he knew he was going to die."

Kaveh, who received the photo in a group chat full of friends mourning the loss, said he and Aghabali were the same age – 28 – and had become friends while studying the same major at school in Iran.

"He was one of my close friends," he said when reached by phone in Dallas, Texas where he's now studying electrical engineering.

"He was one of the most supportive and hilarious people I knew. He was the kind of guy who could make friends with everyone and everyone loved him."

Rescue teams work amid plane parts and debris at the crash site outside of Tehran. (AFP via Getty Images)

Kaveh said he hasn't seen Aghabali in at least three years as they were attending school in different countries, but the friends stayed in contact using apps and groups on social media.

It was to one of those groups that Kaveh says Aghabali sent the photo of himself sitting on the plane.

After news of the crash broke, a mutual friend who is also studying in the United States sent it to him.

Kaveh said one of his friends told them he had checked in with Aghabali to see what flight he would be on and was told he was flying back to Canada by way of Ukraine.

Still, they weren't sure if the plane that went down was his, so they scoured the passenger list and found his name.

"It's really heartbreaking," he added, describing Aghabali as someone who was very intelligent and loved to make others laugh.

Reza Safari, 26, a research assistant at McMaster University knew Aghabali and Eshaghian.

When he looks at the photo of the duo before they boarded their plane, he wonders what was going through their head.

"Maybe they knew that something would happen, I don't know," Safari told CBC.

"The good thing is they look happy. I can see their happy faces. I can see their smiles."

He said Eshaghian was one of his best friends.

They met back in 2014, studying at Sharif University in Iran.

"He was always optimistic about the future. He said he would go to work with NASA," Safari said.

The Iranian university also shared a list of former students it believes to be dead. Aghabali and Eshaghian were both on the list.

Safari said when Eshaghian started at McMaster in late 2017 to study, they kept in touch with monthly calls and by attending Iranian student events.

Mehdi Eshaghian was an engineering students at the McMaster's automotive resource centre. He believed to be on Flight PS752 which crashed Wednesday. (Facebook)

And that's where Safari met Aghabali. Safari didn't know him well but one thing stuck out — his grit.

"I remember he was talking about a project that was too hard for him and his supervisor always pushed him to do extra things, but he was always happy because he said " I know I have a good future in this,' " Safari said.

"When I heard he was involved [in the crash], I was really upset."

Iman Aghabali was studying engineering at McMaster University and was reportedly on board the Ukrainian International Airlines plane that crashed and killed all 176 people passengers. (Facebook)

Have you been personally affected by the plane crash in Iran?​ If you would like to share your story with CBC News, you can do so here.

Students in Iranian groups scrambled to check in on each other through group messages and social media.

Today, they're mourning and consoling one another. A spokesperson for McMaster's Iranian Graduate Society says many people were shocked and some stayed home today, unable to come to school.

Kaveh says Iranian students who end up studying abroad leave their hometowns in search of a good education they can use to help humanity.

When he thinks about what happened he's struck by how it could have been him or so many of his other friends.

"I can feel how my parents and my friends would feel about it."

The McMaster Iranian Graduate Society says it needs permission from the school to go ahead with the memorial ceremony. It plans to host the event either on Thursday or Friday, though they say some professors held impromptu ceremonies of their own to remember the students from Iran.

Doug Welch, the dean of graduate studies told CBC the university has a large Iranian student population and called the crash a loss for the world.

"This flight had a whole set of very young people, many of them going back to their studies to help make the world a better place and with this one crash there has been a great loss of a lot of future possibilities," he said.

The campus is flying their flags at half-mast Thursday to honour the crash victims.

McMaster University is providing resources to anyone affected by the tragic flight.