940971
diff --git a/scp.c b/scp.c
940971
index 60682c68..9344806e 100644
940971
--- a/scp.c
940971
+++ b/scp.c
940971
@@ -714,7 +714,9 @@ toremote(int argc, char **argv)
940971
 			addargs(&alist, "%s", host);
940971
 			addargs(&alist, "%s", cmd);
940971
 			addargs(&alist, "%s", src);
940971
-			addargs(&alist, "%s%s%s:%s",
940971
+			addargs(&alist,
940971
+			    /* IPv6 address needs to be enclosed with sqare brackets */
940971
+			    strchr(host, ':') != NULL ? "%s%s[%s]:%s" : "%s%s%s:%s",
940971
 			    tuser ? tuser : "", tuser ? "@" : "",
940971
 			    thost, targ);
940971
 			if (do_local_cmd(&alist) != 0)
940971