Defence counsel James Rapley QC said the scientific evidence from the ESR witness about blood found at the scene in the hallway and in the bedroom indicated movement, showing that there had been a fight.
During that fight, Prasad got the better of Ali and rendered the fatal blows to the head. "The evidence from the scene tells us there was movement before the head injuries," said Rapley.
The evidence was that the head injuries would have rendered Ali immobile straight away, but the evidence from the scene and the damage to both men's clothing indicated there was a fight and movement before the head injuries were inflicted, he said.
Prasad said in his statement to the police: "He came at me. He was shouting and fighting with me."
Evidence from a neighbour who had heard screaming from Ali's apartment was that she thought she heard fighting. She told the court she heard "noises like pushing or shoving, or hitting each other".
"In certain circumstances, depending on the threat and what is happening, self-defence does apply to all crimes, even murder," said Rapley.
He said Prasad did not intend to kill Ali, or cause him grievous bodily harm knowing that it was likely to cause death, or being reckless about whether death ensued.
Crown prosecutor Barnaby Hawes described Prasad's actions as "a planned and contemplated killing".
He ruled out an argument of self-defence even if Ali had pushed, kicked or punched Prasad first when he returned to his apartment, and found him sitting on the bed holding a hammer.
A neighbour said they heard sounds of a struggle, but this did not indicate anything about self-defence.
He also ruled out the idea of "proportional response", saying that Prasad's attack caused "plainly visible catastrophic head injuries" and would have continued when he was defenceless, dying, and perhaps even dead.
"Mr Ali was the victim of six months of pent-up rage and aggression," said Hawes.
Justice Osborne will sum up for the jury on Friday morning, before the jury retires to consider its verdict.