diff --git a/sqlparse/filters/others.py b/sqlparse/filters/others.py
index df4d861..b0bb898 100644
--- a/sqlparse/filters/others.py
+++ b/sqlparse/filters/others.py
@@ -26,6 +26,13 @@ class StripCommentsFilter(object):
             if (prev_ is None or next_ is None or
                     prev_.is_whitespace or prev_.match(T.Punctuation, '(') or
                     next_.is_whitespace or next_.match(T.Punctuation, ')')):
+                # Insert a whitespace to ensure the following SQL produces
+                # a valid SQL. For example:
+                #
+                # Before: select a--comment\nfrom foo
+                # After: select a from foo
+                if prev_ is not None and next_ is None:
+                    tlist.tokens.insert(tidx, sql.Token(T.Whitespace, ' '))
                 tlist.tokens.remove(token)
             else:
                 tlist.tokens[tidx] = sql.Token(T.Whitespace, ' ')

diff --git a/tests/test_format.py b/tests/test_format.py
index 72af62e..aff07c1 100644
--- a/tests/test_format.py
+++ b/tests/test_format.py
@@ -50,6 +50,19 @@ class TestFormat(object):
         sql = 'select-- foo\nfrom -- bar\nwhere'
         res = sqlparse.format(sql, strip_comments=True)
         assert res == 'select from where'
+        sql = 'select *-- statement starts here\n\nfrom foo'
+        res = sqlparse.format(sql, strip_comments=True)
+        assert res == 'select * from foo'
+        sql = 'select * from foo-- statement starts here\nwhere'
+        res = sqlparse.format(sql, strip_comments=True)
+        assert res == 'select * from foo where'
+        sql = 'select a-- statement starts here\nfrom foo'
+        res = sqlparse.format(sql, strip_comments=True)
+        assert res == 'select a from foo'
+        sql = '--comment\nselect a-- statement starts here\n' \
+              'from foo--comment\nf'
+        res = sqlparse.format(sql, strip_comments=True)
+        assert res == 'select a from foo f'
 
     def test_strip_comments_invalid_option(self):
         sql = 'select-- foo\nfrom -- bar\nwhere'

strip_comments causing syntax error
If there is no space between comments and keyword, the output causes a syntax error. Here's an example:

```python
import sqlparse

sql='''select * from table1--this is a comment
inner join table2 on table1.id = table2.id--this is a comment
where table1.a=1'''

sqlparse.format(sql,strip_comments=True)
```
This gives the following as output:
`select * from table1inner join table2 on table1.id = table2.idwhere table1.a=1`
tests/test_format.py::TestFormat::test_strip_comments_single
tests/test_format.py::TestFormat::test_keywordcase tests/test_format.py::TestFormat::test_keywordcase_invalid_option tests/test_format.py::TestFormat::test_identifiercase tests/test_format.py::TestFormat::test_identifiercase_invalid_option tests/test_format.py::TestFormat::test_identifiercase_quotes tests/test_format.py::TestFormat::test_strip_comments_invalid_option tests/test_format.py::TestFormat::test_strip_comments_multi tests/test_format.py::TestFormat::test_strip_ws tests/test_format.py::TestFormat::test_strip_ws_invalid_option tests/test_format.py::TestFormat::test_preserve_ws tests/test_format.py::TestFormat::test_notransform_of_quoted_crlf tests/test_format.py::TestFormatReindentAligned::test_basic tests/test_format.py::TestFormatReindentAligned::test_joins tests/test_format.py::TestFormatReindentAligned::test_case_statement tests/test_format.py::TestFormatReindentAligned::test_case_statement_with_between tests/test_format.py::TestFormatReindentAligned::test_group_by tests/test_format.py::TestFormatReindentAligned::test_group_by_subquery tests/test_format.py::TestFormatReindentAligned::test_window_functions tests/test_format.py::TestSpacesAroundOperators::test_basic tests/test_format.py::TestSpacesAroundOperators::test_bools tests/test_format.py::TestSpacesAroundOperators::test_nested tests/test_format.py::TestSpacesAroundOperators::test_wildcard_vs_mult tests/test_format.py::TestFormatReindent::test_option tests/test_format.py::TestFormatReindent::test_stmts tests/test_format.py::TestFormatReindent::test_keywords tests/test_format.py::TestFormatReindent::test_keywords_between tests/test_format.py::TestFormatReindent::test_parenthesis tests/test_format.py::TestFormatReindent::test_where tests/test_format.py::TestFormatReindent::test_join tests/test_format.py::TestFormatReindent::test_identifier_list tests/test_format.py::TestFormatReindent::test_identifier_list_with_wrap_after tests/test_format.py::TestFormatReindent::test_identifier_list_comment_first tests/test_format.py::TestFormatReindent::test_identifier_list_with_functions tests/test_format.py::TestFormatReindent::test_long_identifier_list_with_functions tests/test_format.py::TestFormatReindent::test_case tests/test_format.py::TestFormatReindent::test_case2 tests/test_format.py::TestFormatReindent::test_nested_identifier_list tests/test_format.py::TestFormatReindent::test_duplicate_linebreaks tests/test_format.py::TestFormatReindent::test_keywordfunctions tests/test_format.py::TestFormatReindent::test_identifier_and_functions tests/test_format.py::TestOutputFormat::test_python tests/test_format.py::TestOutputFormat::test_python_multiple_statements tests/test_format.py::TestOutputFormat::test_php tests/test_format.py::TestOutputFormat::test_sql tests/test_format.py::TestOutputFormat::test_invalid_option tests/test_format.py::test_format_column_ordering tests/test_format.py::test_truncate_strings tests/test_format.py::test_truncate_strings_invalid_option2[bar] tests/test_format.py::test_truncate_strings_invalid_option2[-1] tests/test_format.py::test_truncate_strings_invalid_option2[0] tests/test_format.py::test_truncate_strings_doesnt_truncate_identifiers[select tests/test_format.py::test_having_produces_newline tests/test_format.py::test_format_right_margin_invalid_option[ten] tests/test_format.py::test_format_right_margin_invalid_option[2]