In this work, a method for fault diagnosis and localization is proposed. This method adopts the long short-term memory (LSTM) neural network to detect, isolate and determine the component of the system in which a fault has occurred. Unlike the traditional methods used for fault diagnosis, which first extract features from the raw data and then use a classifier in order to diagnose the fault; the LSTM-based method works directly on raw data and builds the classifier. This can be accomplished by training the neural network using the raw data resulting in a trained model (classifier) capturing generalized patterns from this data. This model is used online to diagnose faults and determine the faulty component. The performance of the resulting model is evaluated on testing data. The proposed method has been applied to real time-series data representing sensor readings in spacecraft electrical power distribution systems. The experimental results show promising performance in separating fault modes and identifying the faulty components.