An elderly man was shot Sunday afternoon outside a supermarket in South Miami-Dade, law-enforcement officials said.

The man, who was shot in the leg, was expected to live, officials said.

The shooting took place about 2:30 p.m. at the Publix supermarket at 20201 SW 127th Ave. The victim was putting groceries into his car when a man tried to rob him, witnesses told Miami Herald news partner WFOR-CBS 4. There were no other injuries.