DOWNTOWN LOS ANGELES (KABC) -- A senior was brutally beaten in broad daylight in downtown Los Angeles on Saturday, and witnesses say a security guard's quick thinking helped catch the alleged attacker.A picture, sent to Eyewitness News using the #ABC7Eyewitness showed the victim lying on the ground next to a pool of blood.Los Angeles police said the attack happened around 3:40 p.m. near a Whole Foods on 7th and Olive streets.A transient, said to be mentally unstable, punched and kicked the elderly man several times as he was walking down the street, police said. Witnesses said the senior lives in the neighborhood.A security guard from the Whole Foods grocery store across the street witnessed the attacked, pepper sprayed the suspect and held him down until police arrived.The victim was taken to the hospital in critical condition.Waltay Simmons said the transient man tried to flee, but it was too late."When I asked him what was his problem, he said 'He tried to rape me,' and then he turned and looked at me and started charging at me, so I pulled out my pepper spray and pepper sprayed him. And then he dropped all of his stuff, tried to run away and I tackled him to the ground and handcuffed him," Simmons said.Teresa Morales said she witnessed the attack from her second-story window."He pushed one man and then he headed to the other man, took his back pack and hit him and stopped on his head," she said.People who live in downtown L.A. said they often encounter homeless people who are on drugs or have a mental illness or both.Just last week, the L.A. City Council voted to restrict the amount of belongings the homeless can have on the sidewalk and said they can sleep there only between 9 p.m. and 6 a.m., but homeless advocates said the restrictions will not help the problems in the area and on Skid Row.Police said the unidentified suspect was arrested and is being charged with attempted murder.