A 29-year-old man was killed after a bizarre episode in Palmdale Sunday afternoon.

Around 4:30 p.m. the man -- who has not yet been publicly identified -- crashed a black car outside of a Carl's Jr. on Avenue S and 25th Street East. He emerged from the car, stripped off all his clothes and then ran naked into a McDonald's across the street from the crash.

Inside the fast food restaurant, he stabbed an 88-year-old man who was eating with his wife and their family.

"The suspect then exited the business and was confronted by a armed security guard at which time he assaulted the security guard," said Lt. Brandon Dean with the Los Angeles County Sheriff's Department.

Witnesses said the attacker tried to stab the security guard, who then opened fire, killing the man.

Both the security guard and the stabbing victim will be OK.

Investigators said they are looking into whether the man was under the influence of drugs or alcohol.