diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 6a10131b078c654accff7f5a106b935cd2989ebb..d2f2544682b5ae38d0a9871e270b1b4e2a5a5f79 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1475,6 +1475,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
                 ResearchLogger.latinIME_maybeDoubleSpacePeriod(textToInsert,
                         false /* isBatchMode */);
             }
+            mWordComposer.doubleSpacePeriod();
             mKeyboardSwitcher.updateShiftState();
             return true;
         }
diff --git a/java/src/com/android/inputmethod/latin/WordComposer.java b/java/src/com/android/inputmethod/latin/WordComposer.java
index 2f81d15d520ae22c16371ae33ec715dac91f70cd..5ecfc67b2555e74d57cacd402ca1144ae5151a23 100644
--- a/java/src/com/android/inputmethod/latin/WordComposer.java
+++ b/java/src/com/android/inputmethod/latin/WordComposer.java
@@ -471,7 +471,12 @@ public final class WordComposer {
         mCapsCount = 0;
         mDigitsCount = 0;
         mIsBatchMode = false;
-        mPreviousWord = mTypedWord.toString();
+        final boolean isWhitespace = 1 == StringUtils.codePointCount(separatorString)
+                && Character.isWhitespace(separatorString.codePointAt(0));
+        // If not whitespace, we don't use the previous word for suggestion. This is consistent
+        // with how we get the previous word for suggestion: see RichInputConnection#spaceRegex and
+        // LatinIME#getNthPreviousWordForSuggestion.
+        mPreviousWord = isWhitespace ? mTypedWord.toString() : null;
         mTypedWord.setLength(0);
         mCodePointSize = 0;
         mTrailingSingleQuotesCount = 0;
@@ -485,6 +490,13 @@ public final class WordComposer {
         return lastComposedWord;
     }
 
+    public void doubleSpacePeriod() {
+        // When a period was entered with a double space, the separator we got has been
+        // changed by a period (see #commitWord). We should not use the previous word for
+        // suggestion.
+        mPreviousWord = null;
+    }
+
     public void resumeSuggestionOnLastComposedWord(final LastComposedWord lastComposedWord,
             final String previousWord) {
         mPrimaryKeyCodes = lastComposedWord.mPrimaryKeyCodes;