This paper presents a real-time early warning and early prevention (EWEP) system which objective is to avoid the occurrence of large scale system blackouts. The EWEP is obtained by combining a state-of-the-art methods for online stability assessment and for identifying effective counteractions into a single operational solution. The EWEP system was implemented on state-of-the-art software platform for applications of wide-area data. The EWEP system's performance was tested on synthetic wide-area measurement snapshots obtained by accurate time domain simulation of the 2003 blackout in Denmark and Sweden. The test results show that the system could automatically provide both an early warning for the blackout and efficiently determine effective countermeasures that would have avoided the blackout from occurring.