Skin cancer classification is an important topic in dermatology and oncology because it provides a framework for diagnosing and managing skin cancer, as well as for research and advocacy efforts. Deep learning-based methods have the potential to improve the efficiency and scalability of skin cancer classification by automatically processing large volumes of images without the need for intervention. The proposed method combines the ResNet50 deep model and long short-term memory (LSTM) network to process sequential data and represent the structural content of lesion texture better to overcome the limitations of a deep learning-based classification algorithm. This hybrid deep classifier, named ResNet50-LSTM, takes advantage of the benefits of both deep networks along with a transfer learning technique which allows a new model to start from a pre-trained model and fine-tune it for the specific task. Three scenarios are demonstrated in this paper that consists, the first one, ResNet50, the second one ResNet50 in combination with transfer learning technique (ResNet50-TL), and the third scenario, (ResNet50- LSTM-TL) deep model. Combining ResNet50, LSTM, and transfer learning techniques can improve the performance of skin cancer classification by allowing the model to take advantage of pre-trained features from a large dataset, analyze sequential features in medical images, and fine-tune them for the specific task of skin cancer classification. The performance of these scenarios is compared with the other deep learning models. The results of the conducted study demonstrate that the proposed third scenario is successful in accurately recognizing various skin cancers, with an impressive accuracy rate of over 99.09%. The findings indicate that the proposed algorithm has the potential to significantly enhance skin cancer classification and by improving their accuracy and efficiency.