Index: /CKEditor/trunk/CHANGES.html
===================================================================
--- /CKEditor/trunk/CHANGES.html	(revision 5959)
+++ /CKEditor/trunk/CHANGES.html	(revision 5960)
@@ -72,4 +72,5 @@
 		<li><a href="http://dev.ckeditor.com/ticket/6189">#6189</a> : Minor code size reduction.</li>
 		<li><a href="http://dev.ckeditor.com/ticket/5045">#5045</a> : uiColor behaved wrong if multiple editors were used with period in their names.</li>
+		<li><a href="http://dev.ckeditor.com/ticket/5766">#5766</a> : Config entry "ignoreEmptyParagraph" should only remove one single empty paragraph in document.</li>
 		<li>Updated the following language files:<ul>
 			<li><a href="http://dev.ckeditor.com/ticket/6427">#6427</a> : Ukrainian;</li>
Index: /CKEditor/trunk/_source/plugins/wysiwygarea/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/wysiwygarea/plugin.js	(revision 5959)
+++ /CKEditor/trunk/_source/plugins/wysiwygarea/plugin.js	(revision 5960)
@@ -15,5 +15,5 @@
 
 	// Matching an empty paragraph at the end of document.
-	var emptyParagraphRegexp = /\s*<(p|div|address|h\d|center)[^>]*>\s*(?:<br[^>]*>|&nbsp;|\u00A0|&#160;)?\s*(:?<\/\1>)?(?=\s*$|<\/body>)/gi;
+	var emptyParagraphRegexp = /(^|<body\b[^>]*>)\s*<(p|div|address|h\d|center)[^>]*>\s*(?:<br[^>]*>|&nbsp;|\u00A0|&#160;)?\s*(:?<\/\2>)?\s*(?=$|<\/body>)/gi;
 
 	var notWhitespaceEval = CKEDITOR.dom.walker.whitespaces( true );
@@ -897,7 +897,7 @@
 									data = editor.dataProcessor.toDataFormat( data, fixForBody );
 
-								// Strip the last blank paragraph within document.
+								// Reset empty if the document contains only one empty paragraph.
 								if ( config.ignoreEmptyParagraph )
-									data = data.replace( emptyParagraphRegexp, '' );
+									data = data.replace( emptyParagraphRegexp, function( match, lookback ) { return lookback; } );
 
 								if ( docType )
