RICHMOND, Va. -- A Richmond police officer is recovering Monday and due in surgery after he was shot Sunday night.

Officers responded to the 1500 block of Magnolia Street, at about 9:30 p.m. Sunday, in response to a disorderly activity call that involved a group of men, according to police.

"When officers arrived, the crowd dispersed. As officers attempted to detain one member of the group, a handgun discharged, wounding the officer," a Richmond Police spokesperson said. "Richmond Police detectives have determined that the weapon, which was being carried concealed inside a backpack by that individual, discharged unexpectedly."

David B. Ford, 22, of Henrico, was later charged with carrying a concealed weapon, a misdemeanor.

The officer suffered a gunshot wound to both legs, police said. He was expected to make a full recovery.

"I’m glad our officer is going to fully recover,” Richmond Police Chief William Smith said. “I’ve visited with him in the hospital. He’s in good spirits. His family is with him. Other officers are visiting him as well. It will be a good day for this Department when he returns to active duty. It’s the unknown threat that every officer must face when they are asked to respond to calls like this one."

Ford had his first court appearance on Monday and was released on a $1,000 personal recognizance bond. His next court appearance is scheduled for August 16.

This is a developing story. Witnesses can send news tips, photos, and video here.