diff --git a/src/ParsingDriver.cc b/src/ParsingDriver.cc
index 0aea25adb1de15af62c69a108fa03c60ad466afb..58c1902fb3dd007f6f206e0dd87613c5ff112fc5 100644
--- a/src/ParsingDriver.cc
+++ b/src/ParsingDriver.cc
@@ -2902,6 +2902,15 @@ ParsingDriver::add_erf(expr_t arg1)
 expr_t
 ParsingDriver::add_steady_state(expr_t arg1)
 {
+  // Forbid exogenous variables, see dynare#825
+  set<int> r;
+  arg1->collectVariables(SymbolType::exogenous, r);
+  if (r.size() > 0)
+    error("Exogenous variables are not allowed in the context of the STEADY_STATE() operator.");
+  arg1->collectVariables(SymbolType::exogenousDet, r);
+  if (r.size() > 0)
+    error("Exogenous deterministic variables are not allowed in the context of the STEADY_STATE() operator.");
+
   return data_tree->AddSteadyState(arg1);
 }