A teenager in Atlanta was fatally shot on Friday after knocking on the door of an apartment he mistakenly thought was the one he shared with his girlfriend, the authorities said.

The teenager, Omarian Banks, approached the apartment at about 12:30 a.m. on Friday and began knocking on the door under the impression that his girlfriend was inside, the police said. After Mr. Banks, 19, walked away, a man inside appeared on his second-floor balcony to confront him and opened fire.

The man suspected of being the gunman, Darryl I. Bynes, 32, has been charged with murder.

Mr. Banks’s girlfriend, Zsakeria Mathis, 23, had been waiting for Mr. Banks because he had called and asked her to open the door. The conversation lasted three seconds.

“I went to open the door and he wasn’t standing right there,” Ms. Mathis said on Sunday. Ms. Mathis could not see Mr. Banks so she started walking out of her apartment and soon heard faint voices.