This study aims to investigate factors affecting daily demand in an emergency department (ED) and to provide a forecasting tool in a public hospital for horizons of up to 7 days.In this study, first the important factors to influence the demand in EDs were extracted from literature then the relevant factors to our study are selected. Then a deep neural network is applied for constructing a reliable predictor.Although many statistical approaches have been proposed for tackling this issue, better forecasts are viable through employing the abilities of machine learning algorithms. Results indicate that the proposed approach outperforms statistical alternatives available in the literature such as multiple linear regression (MLR), autoregressive integrated moving average (ARIMA), support vector regression (SVR), generalized linear models (GLM), generalized estimating equations (GEE), seasonal ARIMA (SARIMA) and combined ARIMA and linear regression (LR) (ARIMA-LR).We applied this study in a single ED to forecast the patient visits. Applying the same method in different EDs may give us a better understanding of the performance of the model. The same approach can be applied in any other demand forecasting after some minor modifications.To the best of our knowledge, this is the first study to propose the use of long short-term memory (LSTM) for constructing a predictor of the number of patient visits in EDs.