diff --git a/core/modules/user/user.module b/core/modules/user/user.module
index 00c91ac..d005fbc 100644
--- a/core/modules/user/user.module
+++ b/core/modules/user/user.module
@@ -1117,19 +1117,21 @@ function user_validate_current_pass(&$form, &$form_state) {
  */
 function user_account_form_validate($form, &$form_state) {
   $account = $form['#user'];
-  // Validate new or changing username.
+
   if (isset($form_state['values']['name'])) {
+    // Validate new or changing username, and check if it is taken by an
+    // existing user, or if it is being used as an existing user's email.
     if ($error = user_validate_name($form_state['values']['name'])) {
       form_set_error('name', $error);
     }
-    elseif ((bool) db_select('users')->fields('users', array('uid'))->condition('uid', $account->uid, '<>')->condition('name', db_like($form_state['values']['name']), 'LIKE')->range(0, 1)->execute()->fetchField()) {
+    elseif ((bool) db_select('users')->fields('users', array('uid'))->condition('uid', $account->uid, '<>')->condition(db_or()->condition('name', db_like($form_state['values']['name']), 'LIKE')->condition('mail', db_like($form_state['values']['name']), 'LIKE'))->range(0, 1)->execute()->fetchField()) {
       form_set_error('name', t('The name %name is already taken.', array('%name' => $form_state['values']['name'])));
     }
   }
 
   $mail = $form_state['values']['mail'];
 
-  if ((bool) db_select('users')->fields('users', array('uid'))->condition('uid', $account->uid, '<>')->condition('mail', db_like($mail), 'LIKE')->range(0, 1)->execute()->fetchField()) {
+  if ((bool) db_select('users')->fields('users', array('uid'))->condition('uid', $account->uid, '<>')->condition(db_or()->condition('mail', db_like($mail), 'LIKE')->condition('name', db_like($mail), 'LIKE'))->range(0, 1)->execute()->fetchField()) {
     // Format error message dependent on whether the user is logged in or not.
     if ($GLOBALS['user']->uid) {
       form_set_error('mail', t('The e-mail address %email is already taken.', array('%email' => $mail)));
diff --git a/core/modules/user/user.test b/core/modules/user/user.test
index a2f7ab1..39784cc 100644
--- a/core/modules/user/user.test
+++ b/core/modules/user/user.test
@@ -133,6 +133,32 @@ class UserRegistrationTestCase extends DrupalWebTestCase {
     $this->assertText(t('The e-mail address @email is already registered.', array('@email' => $duplicate_user->mail)), t('Supplying a duplicate email address with added whitespace displays an error message'));
   }
 
+  /**
+   * Tests registering a previously registered email address as a username.
+   */
+  function testRegistrationUsernameDuplicates() {
+    // Don't require e-mail verification.
+    variable_set('user_email_verification', FALSE);
+
+    // Allow registration by site visitors without administrator approval.
+    variable_set('user_register', USER_REGISTER_VISITORS);
+
+    // Set up a user to check for duplicates.
+    $duplicate_user = $this->drupalCreateUser();
+
+    $edit = array();
+    $edit['name'] = $duplicate_user->name;
+    $edit['mail'] = $this->randomName() . '@example.com';
+    $this->drupalPost('user/register', $edit, t('Create new account'));
+    $this->assertText(t('The name @name is already taken.', array('@name' => $duplicate_user->name)), 'Supplying an exact duplicate username displays an error message');
+
+    // Attempt to register using a registered email as the username.
+    $edit['name'] = $duplicate_user->mail;
+
+    $this->drupalPost('user/register', $edit, t('Create new account'));
+    $this->assertText(t('The name @name is already taken.', array('@name' => $duplicate_user->mail)), 'Supplying a username equal to an email address of an already registered user displays an error message');
+  }
+
   function testRegistrationDefaultValues() {
     // Allow registration by site visitors without administrator approval.
     variable_set('user_register', USER_REGISTER_VISITORS);
