LOS ANGELES — A judge ruled Monday that Casey Kasem should be fed, hydrated and medicated while a court-appointed attorney evaluates the health of the ailing radio personality after his daughter moved to implement end-of-life measures. Kasem, who has dementia, was in critical condition in a Washington state hospital.

His daughter Kerri Kasem, who has been placed in temporary control of his treatment, consulted with doctors and decided in recent days to stop giving her father food, water and medications, attorneys said in court.

Los Angeles Superior Court Judge Daniel S. Murphy ruled that Casey Kasem should receive the treatments while an attorney appointed by the judge meets with Kasem and his doctors.

Kasem was admitted to the hospital with an infected bedsore last week.

Kerri Kasem decided to begin end-of-life measures after doctors determined that feeding and hydrating the celebrity had become increasingly painful, attorney Troy Martin said in court. The judge’s ruling is likely to cause the former “American Top 40″ host more pain, he said.

Casey Kasem’s wife of 34 years, Jean Kasem, appeared in court and said she supported Murphy’s ruling and will ask to be restored as her husband’s caretaker.

“Only God knows when to take someone,” she said.

Outside court, she lashed out at Kerri Kasem and judges who have criticized her for refusing to cooperate with her stepdaughter.