Just want to chime in that it looks/moves like a leech.
Not sure if they are harmful, I wasn't aware of this recently, but only some leeches are parasitic, there are a bunch that are apparently detritovores, or predators of smaller worms/bugs/whatever.
I had one show up in my tank during the fishless cycle, it was bigger then any of the snails currently in there. I pulled it out and tossed it in a little tray of water/snails/plant fragments on a window sill. Seen it in there one day a couple months later. no idea where it was or what it was doing up until then.