A 24-year-old exchange student from Bangladesh accused of stabbing an Australian man in the name of the Islamic State carried out a dry run of the attack just days before, prosecutors allege.

Momena Shoma, who arrived to Melbourne to study at La Trobe University in January, had only been in Australia a handful of weeks when she entered the bedroom of Roger Singaravelu, 56, on February 9 wearing a burqa and stabbing him in his sleep.

Prosecutors said Shoma reportedly yelled “Allahu Akbar” (God is Great) before stabbing Singaravelu in the neck while his 5-year-old daughter watched, news.com.au reported.

Singaravelu survived the attack, telling the Herald Sun last month that he felt “a sharp pain in my neck and work up to see [Shoma] leaning over me with a kitchen knife in her hand.”

“I reactively grabbed on the knife and fought her off,” he said. “My daughter was screaming nearby, and I told her to run and hide.”

He added: “There was blood everywhere.”

Paramedics who arrived at the scene said they found Singaravelu sitting on a plastic chair bleeding heavily from the neck. Shoma was said to have been calm and cooperative when police arrived.

Shoma had been staying in the victim’s house for two days before carrying out an attack that prosecutor Charlie Rozencwajg said was a response to “a call by [ISIS leader Abu Bakr al-Baghdadi] to attack” Australians on their own soil.

Before moving to Singaravelu's home, Shoma had been boarding with another family that claimed she carried out a dry run of the attack by stabbing a mattress.

“She did the practice run on the mattress with the first family that hosted her and they felt intimidated enough to go to whoever organized it, saying ‘We’re scared, we don’t’ want her to continue to living with us,’” Rozencwajg said during a court hearing at Melbourne Magistrates’ Court on Wednesday.

The Australian Homestay Network, who organized housing for Shoma when she arrived in Melbourne, told news.com.au that it was assisting police in the matter, and would not comment on whether her previous hosts raised concerns about her behavior before she was moved.

Aki Munir, who is representing Singaravelu, told the Herald Sun that the other family’s concerns should have been a red flag and that the homestay network should have investigated before placing Shoma with another family.

Shoma remains in police custody and is scheduled to appear in court again on August 1. Her attorney argued Wednesday that he needed time to sift through 1,600 pages of evidence that include text messages, Google search results and “400 encrypted WhatsApp chats.”