A gun-toting robber ended up returning what he stole after learning his victim was staying at a homeless shelter, police said.

York City Police said Larry A. Sanderson II, 22, who has a listed address in Warrington Township, was walking out of the York Rescue Mission in the 300 block of West Market Street about 8:30 p.m. Wednesday when he was approached by the robber.

The robber told Sanderson to empty his pockets but Sanderson replied, "You don't even have a gun," according to police. The robber then showed Sanderson the handle of a large-caliber revolver that was tucked in his waistband, police said.

Sanderson gave the robber his wallet, cell phone, MP3 player, cigarettes and lighter, police said.

But police said the robber wasn't satisfied and ask Sanderson, "Is that all you have?"

Sanderson explained to the robber that he lives at the homeless shelter, police said.

"I can respect that," the robber said, then returned Sanderson's property and calmly walked away, police said.