diff --git a/core/modules/node/content_types.inc b/core/modules/node/content_types.inc
index 538b19f..8927940 100644
--- a/core/modules/node/content_types.inc
+++ b/core/modules/node/content_types.inc
@@ -127,8 +127,10 @@ function node_type_form($form, &$form_state, $type = NULL) {
 
   $form['type'] = array(
     '#type' => 'machine_name',
+    '#field_prefix' => 'custom_',
     '#default_value' => $type->type,
-    '#maxlength' => 32,
+    // 32 characters minus the 'custom_' prefix.
+    '#maxlength' => 25,
     '#disabled' => $type->locked,
     '#machine_name' => array(
       'exists' => 'node_type_load',
@@ -307,6 +309,11 @@ function _node_characters($length) {
 function node_type_form_validate($form, &$form_state) {
   $type = new stdClass();
   $type->type = trim($form_state['values']['type']);
+  // If this is a new type, append 'custom_' to the name.
+  if (empty($form_state['values']['old_type'])) {
+    $type->type = 'custom_' . $type->type;
+    form_set_value($form['type'], $type->type, $form_state);
+  }
   $type->name = trim($form_state['values']['name']);
 
   // Work out what the type was before the user submitted this form
diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeTypeTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeTypeTest.php
index 944af15..d692eab 100644
--- a/core/modules/node/lib/Drupal/node/Tests/NodeTypeTest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/NodeTypeTest.php
@@ -72,8 +72,21 @@ function testNodeTypeCreation() {
       'type' => 'foo',
     );
     $this->drupalPost('admin/structure/types/add', $edit, t('Save content type'));
-    $type_exists = db_query('SELECT 1 FROM {node_type} WHERE type = :type', array(':type' => 'foo'))->fetchField();
+    $type_exists = db_query('SELECT 1 FROM {node_type} WHERE type = :type', array(':type' => 'custom_foo'))->fetchField();
     $this->assertTrue($type_exists, 'The new content type has been created in the database.');
+
+    // Create a content type with the same machine name as one provided by a
+    // disabled module.
+    $edit = array(
+      'name' => $this->randomName(),
+      'type' => 'node_type_test',
+    );
+    $this->drupalPost('admin/structure/types/add', $edit, t('Save content type'));
+
+    // Enable the module with the conflicting content type name.
+    module_enable(array('node_type_test'));
+    $entity_info = entity_get_info('node');
+    $this->assertEqual($entity_info['bundles']['node_type_test']['label'], t('Test node type'), 'The module-defined content type was installed.');
   }
 
   /**
diff --git a/core/modules/node/tests/modules/node_type_test/node_type_test.info b/core/modules/node/tests/modules/node_type_test/node_type_test.info
new file mode 100644
index 0000000..4aeff3d
--- /dev/null
+++ b/core/modules/node/tests/modules/node_type_test/node_type_test.info
@@ -0,0 +1,6 @@
+name = Node type tests
+description = Support module for node type related testing.
+package = Testing
+version = VERSION
+core = 8.x
+hidden = TRUE
diff --git a/core/modules/node/tests/modules/node_type_test/node_type_test.module b/core/modules/node/tests/modules/node_type_test/node_type_test.module
new file mode 100644
index 0000000..f83885c
--- /dev/null
+++ b/core/modules/node/tests/modules/node_type_test/node_type_test.module
@@ -0,0 +1,19 @@
+<?php
+
+/**
+ * @file
+ * A dummy module for testing node type functionality.
+ */
+
+/**
+ * Implements hook_node_info().
+ */
+function node_type_test_node_info() {
+  return array(
+    'node_type_test' => array(
+      'name' => t('Test node type'),
+      'base' => 'node_type_test',
+      'description' => t('Test node type'),
+    ),
+  );
+}
