A man described by police as despondent and possibly suicidal was shot and wounded Friday morning after he allegedly opened fire on police officers who approached him as he sat alone in a car across the street from a high school, officials said.

The shooting broke out about 9 a.m. on the 1500 block of 137th Avenue, prompting the lockdown of the 700-student Korematsu campus of San Leandro High School, officials said. The high school’s main campus at nearby 2200 Bancroft Ave. was also placed on lockdown.

It was not immediately clear if police shot the man or if he suffered a self-inflicted gunshot wound, said Lt. Robert McManus, spokesman for the San Leandro Police Department.

Officers responded to the area after getting a report from family members of a despondent and possibly suicidal individual sitting alone in a car parked in the driveway of a house across the street from the high school campus, McManus said.

A crisis intervention team and negotiators, along with a SWAT team were dispatched to the scene near Bancroft Avenue.

As officers approached the car, the man shot at them and police returned gunfire, McManus said. Seven to nine officers were present when the shooting started, but it was unclear how many fired their weapons, he said.

“Our officers were forced to return fire when they were shot at,” said McManus, adding that no police officers were injured in the confrontation.

The unidentified man was taken to a local trauma center, where he was in stable condition Friday night. He is expected to be released from the hospital this weekend and enter into police custody. He is expected to face charges of attempted murder of a police officer, among other offenses, McManus said. Officers have not released his name.

McManus said a firearm believed to have been wielded by the wounded man was recovered at the scene.

The Alameda County Sheriff’s Office and the Alameda County district attorney were launching investigations.

McManus said the shooting might have been caught on video recorded by police body cameras, which all San Leandro officers are equipped with.

The high school lockdowns were lifted once the scene was secured.

Local resident Chris Banayat, 39, said he was stunned the shooting occurred in his mostly residential and peaceful neighborhood.

“I moved here in March, and it’s been quiet ever since,” said Banayat, standing at the corner of 138th Street and Bancroft Avenue, holding his 2-year-old son, Preston. “There’s not a lot of crime in this area.”

It was the second shooting this year involving San Leandro police. In April, San Leandro police officers shot and wounded a woman in East Oakland after she allegedly rammed a stolen car into an undercover officer’s vehicle, officials said.

Kale Williams and Hamed Aleaziz are San Francisco Chronicle staff writers. E-mail: kwi llliams@sfchronicle.com, haleaziz@sfchronicle.com Twitter: @SFkale, @haleaziz