MIAMI BEACH, Fla. -

A man shot and killed himself in front of a Miami Beach police officer, police say.

The shooting happened outside the Miami Beach Police Department headquarters at 1100 Washington Avenue on Wednesday afternoon.

Police say an officer saw a man inside silver Lexus ES 300 parked outside the police department. When the officer approached the man, he pulled out a gun and shot himself.

"The police said, 'Hey!' The guy was pointing the gun toward the police but he was really pointing it at his head," said one man.

"I saw the cop pointing the gun -- pulled the gun out," said another man. "By the time I heard 'Pop! Pop!' I realized the cop didn't shoot, so I was wondering where the gun fight came from. I realize the gun fight came from in the car."

The man was taken to Jackson Memorial Hospital, where he died, police say.

The man's name wasn't immediately released.