A Portland attorney pleaded guilty Wednesday to a misdemeanor for shooting a pellet air rifle out the window of his 15th-floor apartment near the Oregon Convention Center in an incident that sparked fears about public safety and prompted a robust police response.

Michael Gorman, 37, was sentenced to 12 months of probation and 40 hours community service for discharging a gun in city limits last September.

Gorman, who has no prior criminal record, also must surrender the air rifle to the court so it can be destroyed.

“My client didn’t realize the repercussions,” defense attorney Ben Eder told Multnomah County Circuit Judge Melvin Oden-Orr. “He’s sorry and he’s learned his lesson.”

Deputy District Attorney Eric Palmer, who prosecuted the case, said from a distance, the pellet air rifle looked exactly like a real one.

“The seriousness of this situation cannot be understated,” Palmer said. “What Mr. Gorman did was extremely dangerous. Pointing a pellet air rifle that looks like an assault rifle from an elevated position on a busy weekend in Portland prompted fears of a potential mass shooter.”

Gorman has been licensed with the Oregon State Bar for the past decade; it is not confirmed if he is working as a lawyer. The Oregon State Bar conducted an investigation following the incident and found no evidence of ethical misconduct. Gorman declined to comment on the case.

Gorman said he had been using the air pellet rifle to shoot beer cans on his balcony at the Yard apartments on the east side of the Burnside Bridge, according to a probable cause affidavit.

It raised alarms at the time when police thought they might be dealing with a potential mass shooter. Officers said in the affidavit that the air gun was indistinguishable from a M-4 or AR-15 semi-automatic weapon at a distance.

A woman who was walking below the apartments on a skybridge reported Gorman when she saw him leaning out the window of his apartment with a gun. She took photos of a shirtless Gorman with the gun and sent them to police.

According to the affidavit, police officers arrived at the apartment and saw Gorman pacing back and forth on a balcony holding what they thought to be a rifle. A police team entered the lobby and additional officers arrived to provide cover. Police were waiting to contact Gorman when he left his apartment and was immediately arrested by a group of waiting officers.

Gorman explained to officers that the weapon was a BB gun and he had taken it out to show his girlfriend because they planned to go to a shooting range. Gorman told officers he had leaned out the window to shoot birds or rats.

-- Piper McDaniel; amcdaniel@oregonian.com; 503-221-4307; @piperamcdaniel

Subscribe to Oregonian/OregonLive newsletters and podcasts for the latest news and top stories.