MJ Friend -- He Almost Died During Trial

7/29/2009 1:20 PM PDT

MJ Friend -- He Almost Died During Trial

Michael Jackson had a huge medical scare during his molestation trial -- and according to one friend, a completely freaked out MJ nearly died of dehydration.

Dick Gregory, Jackson's longtime buddy, was on "Nancy Grace" last night, saying he checked in on Michael after getting calls from his parents -- only to find Jacko frantic, crying and saying "They're trying to kill me ... they'll poison me!"

According to Gregory, Jackson was just extremely dehydrated -- and a doc at the hospital he was taken to said if they'd waited 12 more hours for treatment, he would have died.

Michael was on an IV for 12 hours and then released.