A man was shot and killed early Sunday morning during an attempted burglary at an Anaheim medical marijuana dispensary, police said.

Jee Sun Yoon, 20, of Fullerton broke into the dispensary, in the 200 block of North Wilshire Avenue, around 6 a.m. and was spotted by a security guard, Anaheim police Lt. Eric Trapp said.

The security officer confronted Yoon, whom police said had a weapon, and after a struggle, the guard shot him. Trapp would not say what kind of weapon Yoon had.

Officers provided medical help to Yoon, but he was pronounced dead at the scene by firefighter paramedics.

The security guard was not cited and is cooperating with police, Trapp said.

An online search produced several medical marijuana businesses at the location of the shooting. Phone calls to four of them listed on Wilshire Avenue went unanswered Monday afternoon.

Anaheim has around 10 medical marijuana dispensaries within its borders, said city spokeswoman Ruth Ruiz. The businesses are regulated by the city’s code enforcement division, and the city is actively trying to get rid of them.

Anaheim officials enacted the law prohibiting dispensaries and delivery services shortly after the California Supreme Court ruled in 2013 that cities can ban such outlets, despite a statewide ballot measure that legalized medical marijuana in 1994.

“We don’t recognize them as a business,” Ruiz said.

The dispensaries typically have large sums of cash on hand since most banks are wary about doing business with them and they can’t accept debit or credit card transactions.