diff --git a/core/lib/Drupal/Core/Entity/Plugin/DataType/EntityReference.php b/core/lib/Drupal/Core/Entity/Plugin/DataType/EntityReference.php
index 6cf57eb..11a2346 100644
--- a/core/lib/Drupal/Core/Entity/Plugin/DataType/EntityReference.php
+++ b/core/lib/Drupal/Core/Entity/Plugin/DataType/EntityReference.php
@@ -34,6 +34,13 @@
 class EntityReference extends DataReferenceBase {
 
   /**
+   * The entity revision ID.
+   *
+   * @var integer|string
+   */
+  protected $revision_id;
+
+  /**
    * The entity ID.
    *
    * @var int|string
@@ -66,10 +73,18 @@ public function isTargetNew() {
    */
   public function getTarget() {
     if (!isset($this->target) && isset($this->id)) {
-      // If we have a valid reference, return the entity's TypedData adapter.
-      $entity = \Drupal::entityTypeManager()
-        ->getStorage($this->getTargetDefinition()->getEntityTypeId())
-        ->load($this->id);
+      // If we have a valid reference, return the entity's TypedData adapter,
+      // using the revision if we have it, otherwise the id.
+      if ( isset($this->revision_id) ) {
+        $entity = \Drupal::entityTypeManager()
+          ->getStorage($this->getTargetDefinition()->getEntityTypeId())
+          ->loadRevision($this->revision_id);
+      }
+      else {
+        $entity = \Drupal::entityTypeManager()
+          ->getStorage($this->getTargetDefinition()->getEntityTypeId())
+          ->load($this->id);
+      }
       $this->target = isset($entity) ? $entity->getTypedData() : NULL;
     }
     return $this->target;
@@ -93,6 +108,7 @@ public function getTargetIdentifier() {
   public function setValue($value, $notify = TRUE) {
     unset($this->target);
     unset($this->id);
+    unset($this->revision_id);
 
     // Both the entity ID and the entity object may be passed as value. The
     // reference may also be unset by passing NULL as value.
@@ -102,12 +118,16 @@ public function setValue($value, $notify = TRUE) {
     elseif ($value instanceof EntityInterface) {
       $this->target = $value->getTypedData();
     }
-    elseif (!is_scalar($value) || $this->getTargetDefinition()->getEntityTypeId() === NULL) {
-      throw new \InvalidArgumentException('Value is not a valid entity.');
-    }
-    else {
+    elseif (is_scalar($value)) {
       $this->id = $value;
     }
+    elseif (is_array($value) && is_scalar($value['target_id']) && is_scalar($value['target_revision_id'])) {
+      $this->id = $value['target_id'];
+      $this->revision_id = $value['target_revision_id'];
+    }     
+    elseif (!(is_scalar($value) && is_array($value)) || $this->getTargetDefinition()->getEntityTypeId() === NULL) {
+      throw new \InvalidArgumentException('Value is not a valid entity.');
+    }
     // Notify the parent of any changes.
     if ($notify && isset($this->parent)) {
       $this->parent->onChange($this->name);
diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php
index 3d839c2..b6737ee 100644
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php
@@ -47,6 +47,7 @@ class EntityReferenceItem extends FieldItemBase implements OptionsProviderInterf
   public static function defaultStorageSettings() {
     return [
       'target_type' => \Drupal::moduleHandler()->moduleExists('node') ? 'node' : 'user',
+      'reference_revisions' => FALSE,
     ] + parent::defaultStorageSettings();
   }
 
@@ -87,6 +88,13 @@ public static function propertyDefinitions(FieldStorageDefinitionInterface $fiel
     $target_id_definition->setRequired(TRUE);
     $properties['target_id'] = $target_id_definition;
 
+    $target_revision_id_definition = DataReferenceTargetDefinition::create('integer')
+      ->setLabel(t('@label revision ID', array('@label' => $target_type_info->getLabel())))
+      ->setSetting('unsigned', TRUE);
+
+    $target_revision_id_definition->setRequired(FALSE);
+    $properties['target_revision_id'] = $target_revision_id_definition;
+
     $properties['entity'] = DataReferenceDefinition::create('entity')
       ->setLabel($target_type_info->getLabel())
       ->setDescription(new TranslatableMarkup('The referenced entity'))
@@ -116,6 +124,8 @@ public static function schema(FieldStorageDefinitionInterface $field_definition)
     $target_type = $field_definition->getSetting('target_type');
     $target_type_info = \Drupal::entityManager()->getDefinition($target_type);
     $properties = static::propertyDefinitions($field_definition)['target_id'];
+    $settings = $field_definition->getSettings();
+
     if ($target_type_info->entityClassImplements(FieldableEntityInterface::class) && $properties->getDataType() === 'integer') {
       $columns = [
         'target_id' => [
@@ -124,6 +134,20 @@ public static function schema(FieldStorageDefinitionInterface $field_definition)
           'unsigned' => TRUE,
         ],
       ];
+
+      $indexes = [
+        'target_id' => ['target_id'],
+      ];
+      if ($field_definition->getSetting('reference_revisions') == TRUE) {
+        $columns['target_revision_id'] = [
+          'description' => 'The revision ID of the target entity.',
+          'type' => 'int',
+          'not null' => TRUE,
+          'default' => 0,
+          'unsigned' => TRUE,
+        ];
+        $indexes['target_revision_id'] = ['target_revision_id'];
+      }
     }
     else {
       $columns = [
@@ -135,13 +159,14 @@ public static function schema(FieldStorageDefinitionInterface $field_definition)
           'length' => $target_type_info->getBundleOf() ? EntityTypeInterface::BUNDLE_MAX_LENGTH : 255,
         ],
       ];
+      $indexes = [
+        'target_id' => ['target_id'],
+      ];
     }
 
     $schema = [
       'columns' => $columns,
-      'indexes' => [
-        'target_id' => ['target_id'],
-      ],
+      'indexes' => $indexes,
     ];
 
     return $schema;
@@ -179,6 +204,9 @@ public function setValue($values, $notify = TRUE) {
       if (is_array($values) && array_key_exists('target_id', $values) && !isset($values['entity'])) {
         $this->onChange('target_id', FALSE);
       }
+      elseif (is_array($values) && array_key_exists('target_revision_id', $values) && !isset($values['entity'])) {
+        $this->onChange('target_revision_id', FALSE);
+      }
       elseif (is_array($values) && !array_key_exists('target_id', $values) && isset($values['entity'])) {
         $this->onChange('entity', FALSE);
       }
@@ -224,11 +252,27 @@ public function getValue() {
    * {@inheritdoc}
    */
   public function onChange($property_name, $notify = TRUE) {
+    $settings = $this->getSettings();
     // Make sure that the target ID and the target property stay in sync.
     if ($property_name == 'entity') {
       $property = $this->get('entity');
       $target_id = $property->isTargetNew() ? NULL : $property->getTargetIdentifier();
       $this->writePropertyValue('target_id', $target_id);
+      if (isset($settings['reference_revisions']) && $settings['reference_revisions']) {
+        $this->writePropertyValue('target_revision_id', $property->getValue()->getRevisionId());
+      }
+    }
+    elseif ($property_name == 'target_id' && $this->target_id != NULL && $this->target_revision_id) {
+      $this->writePropertyValue('entity', array(
+        'target_id' => $this->target_id,
+        'target_revision_id' => $this->target_revision_id,
+      ));
+    }
+    elseif ($property_name == 'target_revision_id' && $this->target_revision_id && $this->target_id) {
+      $this->writePropertyValue('entity', array(
+        'target_id' => $this->target_id,
+        'target_revision_id' => $this->target_revision_id,
+      ));
     }
     elseif ($property_name == 'target_id') {
       $this->writePropertyValue('entity', $this->target_id);
@@ -262,9 +306,11 @@ public function preSave() {
       // Make sure the parent knows we are updating this property so it can
       // react properly.
       $this->target_id = $this->entity->id();
+      $this->target_revision_id = $this->entity->getRevisionId();
     }
     if (!$this->isEmpty() && $this->target_id === NULL) {
       $this->target_id = $this->entity->id();
+      $this->target_revision_id = $this->entity->getRevisionId();
     }
   }
 
@@ -343,6 +389,12 @@ public function storageSettingsForm(array &$form, FormStateInterface $form_state
       '#disabled' => $has_data,
       '#size' => 1,
     ];
+    $element['reference_revisions'] = [
+      '#type' => 'checkbox',
+      '#title' => $this->t("Reference a specific revision instead of the default revision."),
+      '#default_value' => $this->getSetting('reference_revisions'),
+      '#weight' => -2,
+    ];
 
     return $element;
   }
diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/EntityReferenceAutocompleteWidget.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/EntityReferenceAutocompleteWidget.php
index 11f048e..dd45ad5 100644
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/EntityReferenceAutocompleteWidget.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/EntityReferenceAutocompleteWidget.php
@@ -125,7 +125,13 @@ public function errorElement(array $element, ConstraintViolationInterface $error
    * {@inheritdoc}
    */
   public function massageFormValues(array $values, array $form, FormStateInterface $form_state) {
+    $entity_type = $this->fieldDefinition->getFieldStorageDefinition()->getSetting('target_type');
     foreach ($values as $key => $value) {
+      if($value['target_id']) {
+        $entity = \Drupal::entityTypeManager()->getStorage($entity_type)->load($value['target_id']);
+        // Add the current revision ID.
+        $values[$key]['target_revision_id'] = $entity->getRevisionId();
+      }
       // The entity_autocomplete form element returns an array when an entity
       // was "autocreated", so we need to move it up a level.
       if (is_array($value['target_id'])) {
@@ -133,7 +139,6 @@ public function massageFormValues(array $values, array $form, FormStateInterface
         $values[$key] += $value['target_id'];
       }
     }
-
     return $values;
   }
 
diff --git a/core/modules/field/src/Tests/EntityReference/EntityReferenceFileUploadTest.php b/core/modules/field/src/Tests/EntityReference/EntityReferenceFileUploadTest.php
index ebb0ba1..aaf5ac8 100644
--- a/core/modules/field/src/Tests/EntityReference/EntityReferenceFileUploadTest.php
+++ b/core/modules/field/src/Tests/EntityReference/EntityReferenceFileUploadTest.php
@@ -37,6 +37,13 @@ class EntityReferenceFileUploadTest extends WebTestBase {
    */
   protected $nodeId;
 
+  /**
+   * This test creates simple config on the fly breaking schema checking.
+   *
+   * @var bool
+   */
+  protected $strictConfigSchema = FALSE;
+
   protected function setUp() {
     parent::setUp();
 
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/EntityReference/EntityReferenceAutocompleteWidgetTest.php b/core/tests/Drupal/FunctionalJavascriptTests/EntityReference/EntityReferenceAutocompleteWidgetTest.php
index 511dee6..cb9f386 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/EntityReference/EntityReferenceAutocompleteWidgetTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/EntityReference/EntityReferenceAutocompleteWidgetTest.php
@@ -18,6 +18,14 @@ class EntityReferenceAutocompleteWidgetTest extends JavascriptTestBase {
   use EntityReferenceTestTrait;
   use NodeCreationTrait;
 
+
+  /**
+   * This test creates simple config on the fly breaking schema checking.
+   *
+   * @var bool
+   */
+  protected $strictConfigSchema = FALSE;
+
   /**
    * {@inheritdoc}
    */
