The suspect has been identified as 22-year-old Daniel Elizarraras.
MORE: Man shot by sheriff's deputies at Del Mar racetrack prior to Ice Cube concert
Authorities said he wanted a ticket to the Ice Cube concert after the horse races, but no more were available.
That's when deputies said he fired several shots with a handgun into the crowd. Deputies returned fire, shooting him.
"I was standing at the front gate and I was going to meet my son and I was going to give him the ticket, and I just heard gunshots just ringing off bang, bang, bang, bang, bang over and over and over again, and then I saw a guy on the ground and cops shot him," said Joel Sweeney, a witness.
Elizarraras, who is from Escondido, was taken to the hospital. He was reported to be in stable condition and is expected to survive, the San Diego County Sheriff's Department said.
No one else was hurt.
Ice Cube did perform. He took the stage an hour later.