diff --git a/lib/ftp.c b/lib/ftp.c
index 68610f95867d4392506453925d51da7fda118045..5aa617edd020783c619c2e95d78984f50a0dbcf5 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -2102,7 +2102,9 @@ static CURLcode ftp_state_port_resp(struct connectdata *conn,
   ftpport fcmd = (ftpport)ftpc->count1;
   CURLcode result = CURLE_OK;
 
-  if(ftpcode != 200) {
+  /* The FTP spec tells a positive response should have code 200.
+     Be more permissive here to tolerate deviant servers. */
+  if(ftpcode / 100 != 2) {
     /* the command failed */
 
     if(EPRT == fcmd) {