SAN FRANCISCO — Police shot and seriously wounded a man armed with a look-alike air gun and another person during an argument across the street from the Mission District police station early Sunday.

Two groups of people got into a tussle around 2 a.m. at Valencia and 17th streets, when a man pulled out what appeared to be a handgun. That prompted an observer to run across the street to the Mission District police station and alert officers to the trouble, said San Francisco police Officer Gordon Shyy.

An officer saw the man pointing the suspected firearm at a group of people and opened fire “in order to preserve the safety of those people,” Shyy said. The officer’s gunfire left the armed man and another person with life-threatening injuries. It wasn’t clear what role the other person played in the altercation.

After the shooting, police realized the gun wasn’t a firearm, but an air-powered pistol that shoots some type of projectiles, said Shyy. Police will test the air gun to see if it was in working order at the time police opened fire.

Both wounded people were rushed to San Francisco General Hospital, where they remained hospitalized with life-threatening injuries Sunday afternoon.

While San Francisco police and the San Francisco District Attorney’s Office investigate the shooting, the officer was on paid administrative leave.

Contact Joshua Melvin at 650-348-4335. Follow him at Twitter.com/melvinreport.