diff --git a/typo3/sysext/core/Classes/Database/RelationHandler.php b/typo3/sysext/core/Classes/Database/RelationHandler.php
index e95c550d5060c69e8b4e17e5ad97a8fd5418be7f..737664f83dd212494b8cba828ed61b3c168921cb 100644
--- a/typo3/sysext/core/Classes/Database/RelationHandler.php
+++ b/typo3/sysext/core/Classes/Database/RelationHandler.php
@@ -931,6 +931,25 @@ class RelationHandler
                 }
                 // Update accordant fields in the database:
                 if (!empty($updateValues)) {
+                    // Update tstamp if any foreign field value has changed
+                    if (!empty($GLOBALS['TCA'][$table]['ctrl']['tstamp'])) {
+                        $currentRow = BackendUtility::getRecord($table, $uid, implode(',', array_keys($updateValues)) , '', true);
+                        $needTstampUpdate = false;
+                        if (empty($currentRow)) {
+                            $needTstampUpdate = true;
+                        } else {
+                            foreach ($currentRow as $field => $curValue) {
+                                if ((string)$curValue !== (string)$updateValues[$field]) {
+                                    $needTstampUpdate = true;
+                                    break;
+                                }
+                            }
+                        }
+                        if ($needTstampUpdate) {
+                            $updateValues[$GLOBALS['TCA'][$table]['ctrl']['tstamp']] = $GLOBALS['EXEC_TIME'];
+                        }
+                    }
+
                     $GLOBALS['TYPO3_DB']->exec_UPDATEquery($table, 'uid=' . (int)$uid, $updateValues);
                     $this->updateRefIndex($table, $uid);
                 }