(CNN) -- Michael Jackson couldn't sleep.
Maybe it was anxiety over his upcoming comeback concert series in London. Maybe his body was trying to process too many different medications.
The reason may never be known, but a sworn affidavit makes clear that the King of Pop couldn't get rest the night before he died.
The affidavit, from Detective Orlando Martinez of the Los Angeles Police Department, outlines probable cause for search warrants on the offices of doctors who are thought to have treated Jackson.
Yet is also opens a window into the final hours of Michael Jackson, revealing information about his treatment and the drugs given him by Dr. Conrad Murray, his personal physician, before his death.
Based on interviews, visits to Jackson's home as well as records and documents gathered during the investigation, the affidavit provides the following account of Jackson's last days:
In early May, Jackson had hired Murray, a cardiologist. The singer was spending long days rehearsing for concerts that he saw as crucial to reviving his career.
For six weeks, Murray told police, he treated Jackson for insomnia. He said he had been giving the singer an intravenous drip with 50 milligrams of propofol, diluted with lidocaine, every night to help him sleep.
Jackson was already familiar with propofol, Murray said. The singer even called it his "milk" because of its milky appearance, he said.
With the concerts rapidly approaching, Jackson started to need these drugs every night, Murray said -- and the doctor said he worried that Jackson was becoming addicted to propofol. He wanted to wean Jackson off the drug.
Three days before Jackson died -- on Monday, June 22 -- Murray gave the singer a combination of drugs that he hoped would gradually move the singer off propofol.
That mixture involved propofol, the anti-anxiety drug lorazepam (known by its brand name, Ativan) and midazolam (known as Versed). It succeeded in helping Jackson to sleep for that night and the next, Murray said.
But by the night of June 24, Jackson was again unable to sleep.
At 1:30 a.m. on June 25, Murray decided to forgo the propofol in favor of 10 milligrams of Valium. Half an hour later, with Jackson still awake in bed, Murray injected him with two milligrams of lorazepam.
It still wasn't working.
At 3 a.m., Murray gave the singer two milligrams of midazolam, pushed slowly into his IV. And two hours later, with Jackson still awake, Murray administered another two milligrams of lorazepam through Jackson's IV.
The drugs still did nothing to help Jackson sleep.
At 7:30 a.m., Murray gave the singer another two milligrams of midazolam in his IV.
By that point, Murray wasn't even leaving Jackson's room anymore, let alone his bedside. The doctor told police he sat next to the singer in his bedroom, monitoring Jackson's pulse and oxygen levels.
More than three hours later, despite a night of medication and doctor's care, Jackson was still awake.
Jackson was now repeatedly asking -- even demanding -- that Murray give him more propofol to help him sleep, the doctor told police. So Murray finally administered 25 milligrams of propofol diluted with lidocaine via Jackson's IV drip.
The singer now had his "milk," and it worked. After a restless night, Jackson was finally able to close his eyes and go to sleep.
Murray told police he watched Jackson sleep for about 10 minutes before going to the bathroom. It had been a long night for both of them.
The trip to the bathroom took less than two minutes, Murray told police. But when he came back, he said, he saw Jackson wasn't breathing.
He started CPR, but it didn't work.
Jackson was rushed to the hospital and pronounced dead later that afternoon.
According to court documents released Monday, Los Angeles Chief Medical Examiner-Coroner Dr. Lakshmanan Sathyavagiswaran concluded Jackson died of an overdose of propofol.
Sathyavagiswaran reached that preliminary conclusion after reviewing toxicology results carried out on Jackson's blood, according to a search warrant and affidavit unsealed in Houston, Texas.
The coroner's office would not comment on the statements in the affidavit. But Ed Chernoff, Murray's attorney, took issue with some of the information included in the court documents.
"Much of what was in the search warrant affidavit is factual. However, unfortunately, much is police theory," Chernoff said, specifically referring to media reports that Jackson's death would be ruled a homicide by the Los Angeles County coroner.
The Los Angeles District Attorney's office says it has not yet seen a police report on the case, and no criminal charges have been filed.