LOS ANGELES -- A man sentenced to a mental health facility for stalking actress Mila Kunis was recaptured Wednesday in Santa Monica, four days after he escaped from the institution, sheriff's officials said.

Deputies with the Los Angeles County Sheriff's Department's major crimes division took Stuart Lynn Dunn into custody in an alley about a half-mile from the beach, sheriff's spokeswoman Nicole Nishida said.

Dunn pleaded no contest to stalking Kunis in January 2013. He was sentenced to six months of rehabilitation, five years of probation and ordered to stay away from the actress and her representatives for 10 years.

He disappeared Saturday night from a mental health centre in Pomona, about 50 miles from where he was captured.

Authorities believe he got out of the Olive Vista Behavioral Health Center by climbing through a bathroom window and scaling a barbed-wire fence. Deputy Chief Reaver Bingham of the Los Angeles County Probation Department said officials went looking for him after he didn't return from a shower.

Authorities said Dunn had few contacts in the Pomona area so they focused their search on gathering places for transient populations in western Los Angeles County. That included parts of Santa Monica, West Hollywood, Hollywood and Beverly Hills. The area where he eventually was found is not far from such a gathering place near the beach.

"Mr. Dunn's arrest was the result of the diligent efforts led by the Los Angeles County Probation Department's special enforcements operation and the Los Angeles Sheriff's Department's major crimes division," sheriff's officials said in a statement.

Dunn was arrested in February 2012 for breaking into Kunis' vacant condominium. He was taken into custody again months later after he waited for the star of "Black Swan" and "That '70s Show" outside her gym for three days, violating a restraining order.

Kunis was notified of his escape, and authorities said at the time he should be considered dangerous.

"We never know the state of mind of an individual," Bingham said after Dunn's escape. "He does have a fixation on the original victim, so that's why."