The man, whose name and age were not given, came to the ticket window at the Del Mar Fairgrounds about 6:40 p.m., the department said in a news release.
Shortly after he was told there were no more tickets, an argument ensued and nearby deputies came to the scene. The man pulled out a silver-plated semi-automatic handgun and fired several shots into an area crowded with people, the department said. The deputies shot him.
The man was taken to Scripps Memorial Hospital La Jolla, the department said. His condition has not been released.
It appears no one else was injured, the department said.
A video of the shooting that was posted on Twitter records the sounds of several shots being fired before a man falls to the ground. Two deputies appear to holster their guns as one shouts at a gathering crowd to "get back, get back, get back." Passing concert-goers can be heard shouting expletives after the shooting.
In a broadcast of the track's final race of the day that was posted on Twitter, an announcer can be heard saying, "There's gunfire at the track," as horses move along the turf course, the Union-Tribune reported.
The situation has been contained. The concert is moving forward as planned.— Del Mar Racetrack (@DelMarRacing) September 3, 2018
At 7:22 p.m., the Del Mar Racetrack tweeted that the "situation has been contained" and said the concert "is moving forward as planned."
Associated Press writer Michael Balsamo contributed.