diff --git a/src/common/env.c b/src/common/env.c
index dec0ca2a8afad8dae468dc85f62795fc2c354d9f..c0aa4426d3d215b6867805850314cc281b41f7bd 100644
--- a/src/common/env.c
+++ b/src/common/env.c
@@ -705,10 +705,16 @@ int setup_env(env_t *env, bool preserve_env)
 		rc = SLURM_FAILURE;
 	}
 
-	if (env->stepid >= 0
-	    && setenvf(&env->env, "SLURM_STEPID", "%d", env->stepid)) {
-		error("Unable to set SLURM_STEPID environment");
-		rc = SLURM_FAILURE;
+	if (env->stepid >= 0) {
+		if (setenvf(&env->env, "SLURM_STEP_ID", "%d", env->stepid)) {
+			error("Unable to set SLURM_STEP_ID environment");
+			rc = SLURM_FAILURE;
+		}
+		/* and for backwards compatability... */
+		if (setenvf(&env->env, "SLURM_STEPID", "%d", env->stepid)) {
+			error("Unable to set SLURM_STEPID environment");
+			rc = SLURM_FAILURE;
+		}
 	}
 
 	if (!preserve_env && env->nhosts