An American flag-draped daredevil, who climbed a 200-foot crane in California as thousands of stunned spectators watched, was taken into custody Sunday three hours after the dangerous display began, police said.

It’s still unclear why the man, who has not yet been identified, decided to climb the crane just after 5 p.m. Sunday on Hollywood Boulevard. The man was spotted shirtless and barefoot climbing up and down the crane boom, FOX11 LA reported.

At one point, he took an American flag that was on the crane and wrapped it around himself. He was also seen dangling from a rope.

Thousands of people watched the incident unfold for three hours.

“He climbed up and he was shirtless already, like he had his jeans on, then all of a sudden took them off and threw them on the ground," a witness told FOX11. "He took the American flag off the crane, was wearing it as a cape pretty much."

The man eventually came down from the crane on his own. Los Angeles Police Department Sgt. Jose Torres said the man was “very apologetic” about the bizarre incident.

"He was rambling a lot of different things, not very comprehensive," Torres told KTLA. "The main thing is that he was mostly sorry for what he did and telling us that he didn’t want to put us in danger, nor did he want us to use all the resources that we did just for him."

The man was taken to a nearby hospital for a mental evaluation.