diff --git a/dist/tools/pyterm/pyterm b/dist/tools/pyterm/pyterm
index 174a1022dd71596f75f67368114646c4149e07f8..72762cfc0cc8b2cc406e03cac3c531fc85af229d 100755
--- a/dist/tools/pyterm/pyterm
+++ b/dist/tools/pyterm/pyterm
@@ -288,6 +288,12 @@ class SerCmd(cmd.Cmd):
         """
         self.ser.write("help\n".encode("utf-8"))
 
+    def do_EOF(self, line):
+        """Handle EOF (Ctrl+D) nicely."""
+        self.logger.debug("Received EOF")
+        self.do_PYTERM_exit("")
+        sys.exit(0)
+
     def complete_date(self, text, line, begidx, endidm):
         """Auto completion for date string.
         """