We use machine-learning to train communication-free protective relays of a closed-loop distribution system. The proposed algorithm in the protective relays affords primary protection against electrical faults and classifies the fault types. We propose to replace a conventional algorithm (that depends on communication and fault direction information) with supervised learning (long short-term memory [LSTM]) to protect a closed-loop distribution system. To achieve this aim, we propose LSTM networks employing 12 types of time-series electrical data measured/calculated by each relay of a test power system with distributed energy resources (DERs). After adjustment of LSTM network hyperparameters to enhance circuit-breaker performance, all relays were trained using 6,000 cases and tested employing 3,000 cases, respectively. Simulations showed that the proposed protective relay showed mean accuracies over 96% in protection and over 93% in fault type classification; the proposed method afforded better performance in protection over relays having the conventional protection algorithm.