Man ditched gun while running from officers: Police