Analyzing adverse drug events (ADEs) is an integral part of drug safety monitoring, which plays a significant role in medication decision-making. The increasing prevalence of health-related social media may provide an avenue for drug safety profiling using patients' online posts. Recent advances in machine learning, especially in deep learning, have dramatically benefited ADE detection and extraction. However, despite the wide use of state-of-the-art deep learning models, prior research has predominantly analyzed each post independently instead of treating the relevant posts holistically. In this study, guided by the theories of transfer of learning, we adopted the design science research methodology and developed a deep learning-based approach by innovatively integrating historical profiles for ADE detection and extraction. Our framework—the Historical Awareness Multi-Level Embedding (HAMLE) model—outperformed existing state-of-the-art benchmarks by large margins. We also validated its real-world safety monitoring application using the Food and Drug Administration's drug safety warnings, and it showed promising performance in identifying previously unknown ADEs. This confirmed its potential for use as an early warning system for postmarketing surveillance. Furthermore, to evaluate the generalizability of HAMLE, we further tested it on a formal medical dataset extracted from PubMed, and it demonstrated robustness and achieved new state-of-the-art results. Our strategy of building a historical awareness deep learning model, inspired by extant theories, could create a new way to integrate historical profiles and characteristics to support various business tasks in different domains.