diff --git a/var/spack/repos/builtin/packages/mvapich2/package.py b/var/spack/repos/builtin/packages/mvapich2/package.py
index 030e03b7f12d864c21748ff73870340744e06026..c3e9f1c2f4b6e8fccbae837dcbc6f2f0c244e830 100644
--- a/var/spack/repos/builtin/packages/mvapich2/package.py
+++ b/var/spack/repos/builtin/packages/mvapich2/package.py
@@ -199,6 +199,9 @@ def file_system_options(self):
 
     def setup_environment(self, spack_env, run_env):
         spec = self.spec
+        # mvapich2 configure fails when F90 and F90FLAGS are set
+        spack_env.unset('F90')
+        spack_env.unset('F90FLAGS')
         if 'process_managers=slurm' in spec:
             run_env.set('SLURM_MPI_TYPE', 'pmi2')