Rory MacPherson filmed the animal and his video has now been viewed tens of thousands of times on Facebook.
In it, Mr MacPherson can be heard laughing as the animal tries to bite his feet.
But when the 24-year-old tries to escape to his car, the otter runs after him at full speed.
Mr MacPherson, from Lockerbie, told the BBC Scotland news website: “I nearly hit him with my car so I pulled to a stop, got out and it was still there and I tried to get closer.
“I don’t know what made it go a little bit crazy.”
The harvesting manager for Scottish Woodlands added: “It’s not often you see an otter, never mind get the chance to photograph it.
“I assumed it would run away pretty quickly but I got a little bit more than I expected.”
He said the otter had “huge” teeth and it was definitely biting his feet.
“I thought, how is this going to end?” he said. “It wouldn’t leave my feet alone. I thought I’ll run away and hopefully it won’t catch up with me. It’s made for a funny video.”