Image copyright Washington Police Image caption Police released a photo of Arcan Cetin from Oak Harbor

Prosecutors in the US state of Washington say a 20-year-old man in custody has confessed to going on a murderous rampage in a shopping centre, which left five people dead.

Arcan Cetin was arrested in his hometown Oak Harbor on Saturday, nearly 24 hours after the attack in Burlington, 40 minutes' drive away.

He was born in Turkey and is a legal US permanent resident, officials say.

Investigators say they are not ruling out any motives, including terrorism.

Cetin's stepfather says he has a history of mental health issues.

According to the Associated Press, Cetin's postings online included references to a serial killer and Adolf Hitler, as well as pictures of so-called Islamic State's leader, Abu Bakr al-Baghdadi, and the Iranian Supreme Leader Ayatollah Khomenei.

'Confessed'

Five people - a teenage girl, three women and a man - were killed inside Macy's department store at Cascade Mall on Friday.

Court documents filed by prosecutors allege that Cetin confessed to shooting all five victims with a rifle.

Police said in court papers that all five victims were shot within a minute and the rifle was left on a cosmetics counter before the gunman fled.

At a news conference, police said Cetin had been identified as a suspect after a car connected to him was seen on security camera footage at the shopping centre.

Lt Mike Hawley, of Island County sheriff's department, said the car was later spotted in Oak Harbor. He said he had been on his way to the scene when he saw the suspect by the side of a road and arrested him.

Lt Hawley said the man "said nothing, he was zombie-like" and was not carrying a weapon.

Image copyright AP Image caption The shooting took place inside Macy's department store

Image copyright AP Image caption A prayer service was held for the victims in the city of Sedro-Woolley, Washington

The Seattle Times reported that the youngest victim was 16-year-old Sarai Lara, who had survived cancer as a young child.

Her mother described her as a happy, responsible, driven student.

Burlington is about 65 miles (105km) north of Seattle.