SAN FRANCISCO (AP) — A juvenile suspect is in custody after allegedly shooting San Francisco 49ers wide receiver Ricky Pearsall in the chest Saturday afternoon during an attempted robbery in central San Francisco, officials said.

Pearsall, 23, was released Sunday from San Francisco General Hospital and Trauma Center, according to a statement from the team. He had been listed in fair condition.

Pearsall was walking alone carrying shopping bags to his car shortly after 3:30 p.m. Saturday when a suspect attempted to rob him with a gun on Geary Boulevard in the Union Square area, officials said.

“A struggle between Mr. Pearsall and the suspect ensued and gunfire from the suspect’s gun struck both Mr. Pearsall and the subject," San Francisco Police Chief Bill Scott said during a news briefing.

Officers in the area responded immediately and provided emergency medical aid and arrested the suspect.

Police identified the suspect as a 17-year-old male resident of Tracy, California, about 60 miles (100 kilometers) east of San Francisco, who also was transported to San Francisco General. His condition was not immediately disclosed.

Witnesses reported hearing multiple gunshots. A gun allegedly belonging to the suspect was recovered and investigators believe he acted alone, Scott said.

Video recorded by a witness showed Pearsall, shirtless with a large chest wound, being helped into an ambulance, the San Francisco Chronicle reported.

FILE - San Francisco 49ers first round draft pick Ricky Pearsall speaks during a news conference in April in Santa Clara, Calif. (AP Photo/Godofredo A. Vasquez, File)

“This kind of violence is simply unacceptable in our city and we will do everything in our power to work with District Attorney Brooke Jenkins to ensure that justice is served in this matter," Scott said.

Jenkins told reporters at the briefing that her office expects to make a charging decision by Tuesday or Wednesday and initially will file any charges in the juvenile court system.

Scott said there was no indication Pearsall was targeted because he is a player for the city's football team.

“He and his family, along with the entire San Francisco 49ers organization, would like to thank the San Francisco Police Department, emergency medical services, doctors and staff at San Francisco General Hospital," said the team statement Sunday.

“He’s good,” 49ers teammate Deebo Samuel posted on X. “Thank god!!!!”

Mayor London Breed said she was confident in the district attorney's actions to prosecute the case.

“This is how we hold people accountable in San Francisco. Robberies and any violence like this will not be tolerated in our city," Breed said during the briefing, offering her gratitude to the hospital staff, police and first responders including San Francisco Fire Department personnel.

“This was a terrible and rare incident in Union Square and our thoughts are with Ricky Pearsall and his family. He has a bright future and I look forward to seeing him recover and get back on the field,” Breed said.

Pearsall was drafted in the first round in April by the 49ers with the 31st overall pick but has been slowed by injuries since joining the team.

He missed time during training camp due to hamstring and shoulder issues before returning to practice this past week with a noncontact blue jersey while his shoulder heals.

Pearsall began his college career at Arizona State and transferred to Florida for his final two seasons. He had 65 catches for 965 yards and four touchdowns last season for the Gators and finished his college career with 159 catches for 2,420 yards and 14 TDs.

The Niners have hoped Pearsall could contribute as a rookie as backup to starters Brandon Aiyuk and Samuel.