Hassan Asif, the 25-year-old Pakistani student diagnosed with terminal cancer while studying in Australia, has died with his mother and brother by his side, reported AAP.

Asif’s brother, Rameez, said the young student had died at a Melbourne hospital on Wednesday morning. Rameez and his mother had initially been denied a visa to Australia to visit Asif, who was too sick to travel.

Rameez and his mother arrived on 29 December and had been “a constant and loving presence by [Asif’s] side”, the Melbourne City Mission said in a statement.

Rameez thanked the staff for their care and support of his brother.

“It was like a dream come true to be with Hassan,” he said.

“We literally lost hope when our visas got rejected but we still made it to Australia. I have no words to describe how happy we were to be with Hassan. My brother got the best possible care. Thank you.”

Asif was diagnosed with metastatic melanoma in April while he was studying architecture at Victoria University. He was cared for by the City Mission homeless charity.

Hassan Asif had been receiving outreach palliative care but recently moved to a specialist medical facility when his condition deteriorated. He was too sick to fly home to Pakistan, where he had once hoped to return and begin work as an architect. He wished to spend his final days with his family, but the Australian High Commission initially rejected their visa applications.

The Department of Immigration said based on the information provided in their application, the pair were considered at risk of overstaying their visa. Labor’s immigration spokesman Richard Marles last month described the decision as “disgraceful and heartless” and called on Immigration Minister Peter Dutton to intervene.

After a public outcry in Australia and overseas, the government asked Mr Asif’s family to reapply for their visas, which included information about their finances and support from the local Pakistani community during their stay. The visas were then approved.

Asif’s funeral service will be held on Thursday at the Preston mosque in Melbourne.