"The time he is locked in his cell is effectively 19 hours a day. That is extraordinary," Dr Ellis told Justice David Collins.
"In non-legal terms, this is cruel treatment of anybody," he added.His client had been suicidal, the lawyer said, and remained extremely depressed, living in frequent fear of being tortured if he was sent to China.The lawyer said a seemingly endless succession of short, fearful, dull, miserable days marked his client's life, despite him never being charged."At 4.30 in the afternoon they give him a sleeping pill. This is inhumane treatment."
Dr Ellis said one had to go back probably to the 19th century to find similar examples of people being detained in New Zealand without charge for so long.
He said Mr Kim was subject to "extraordinary" detention, despite authorities describing him as an "ordinary criminal".
Dr Ellis said Mr Kim was experiencing "death row and torture row phenomenon" as he spent years "lingering in jail".
The lawyer said the detention in recent decades of terror suspects in Northern Ireland and Guantanamo Bay was in some aspects comparable to Mr Kim's treatment.
Chinese investigators alleged Mr Kim killed 20-year-old Peiyun Chen in Shanghai in 2009, before dumping her body and fleeing to Korea.
China asked former Justice Minister Simon Power for Mr Kim to be extradited, sparking a long legal process.
Eventually, current Justice Minister Amy Adams said she received undertakings China would not put Mr Kim to death, and he would receive a fair trial.But outside court, Dr Ellis said those guarantees were unreliable.
He also said there was little provision for New Zealanders or humanitarian organisations to monitor the treatment of detainees in Chinese jails.
The lawyer claimed Chinese trials left much to be desired.
"You've got no right to cross-examine witnesses, so you don't get a fair trial. And you've never really got an opportunity to attack the evidence."
The case had strong political dimensions, Dr Ellis said, and raised questions of judicial independence.
"The interface between politics and the law does raise its ugly head."
The lawyer said he believed the personalities of different justice ministers possibly affected the extradition process, and had compelled him to make "strategic" decisions.
He said he was uncomfortable raising the issue with Judith Collins, who served as the Minister from late 2011 to 2014.
"I didn't feel very comfortable her making the decision. So when she resigned we took immediate steps to try and get the new Justice Minister to make a decision, because we thought it might be a fairer process."
The lawyer said he was determined to go all the way to the Supreme Court if necessary.
He also said Mr Kim was allowed only "inadequate" visits from his family, who were very upset at the situation.
"I say Mr Kim is a vulnerable person ... it is a duty on the state to care for his mental health, which they have not done."
Austin Powell, lawyer for the Attorney-General, opposed bail and said Mr Kim presented a serious flight risk.
"My friend has made a lot of the length of time that Mr Kim has been in custody," Mr Powell told the court.
But extradition was always a complex process, he said, and Dr Ellis and Mr Kim should take responsibility for a "catalogue" of failed appeals and repeated adjournments of an eligibility hearing.
"The flight risk in this case is about as high as flight risks can get," Mr Powell said.
"On any view of it, Mr Kim is in a desperate situation."Mr Powell said Mr Kim and his lawyer were desperate to prolong and delay the extradition process, and were now engaged in the " last throw of the dice".
He said Chinese authorities had presented a "forensically strong" and compelling case against Mr Kim, who was now unsurprisingly concerned about being sent to China and jailed for a long time.
"A person in that situation is highly motivated not to be extradited."
Mr Powell said electronic monitoring would not guarantee Mr Kim would adhere to his bail conditions.
A judicial review of Ms Adams' decision was likely in February, the court heard today.
Justice Collins told the court he'd issue a written decision on Mr Kim's bail application. The decision was expected sometime between tomorrow and early next week.