diff --git a/flag.module b/flag.module
index f62e777..0e32ec6 100644
--- a/flag.module
+++ b/flag.module
@@ -217,34 +217,14 @@ function flag_flag_delete(FlagInterface $entity) {
  * Implements hook_user_cancel().
  */
 function flag_user_cancel($edit, $account, $method) {
-  flag_user_account_removal($account);
+  \Drupal::service('flag')->userFlagRemoval($account);
 }
 
 /**
  * Implements hook_user_delete().
  */
 function flag_user_delete(UserInterface $account) {
-  flag_user_account_removal($account);
-}
-
-/**
- * Shared helper for user account cancellation or deletion.
- */
-function flag_user_account_removal(UserInterface $account) {
-  /** var \Drupal\flag\FlagServiceInterface $flag_service */
-  $flag_service = \Drupal::service('flag');
-
-  // Remove flags by this user.
-  $flaggings = $flag_service->getFlaggings(NULL, NULL, $account);
-  foreach ($flaggings as $flagging_id => $flagging) {
-    $flag_service->unflag($flagging->getFlag(), $flagging->getFlaggable(), $account);
-  }
-
-  // Remove flags that have been done to this user.
-  $flaggings = $flag_service->getFlaggings(NULL, $account);
-  foreach ($flaggings as $flagging_id => $flagging) {
-    $flag_service->unflag($flagging->getFlag(), $flagging->getFlaggable());
-  }
+  \Drupal::service('flag')->userFlagRemoval($account);
 }
 
 /**
diff --git a/src/FlagService.php b/src/FlagService.php
index 0e22d61..bf746b7 100644
--- a/src/FlagService.php
+++ b/src/FlagService.php
@@ -13,6 +13,7 @@ use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Core\Session\AccountInterface;
 use Drupal\flag\Event\FlagEvents;
 use Drupal\flag\Event\FlaggingEvent;
+use Drupal\user\Entity\User;
 use Symfony\Component\EventDispatcher\EventDispatcherInterface;
 
 /**
@@ -272,6 +273,36 @@ class FlagService implements FlagServiceInterface {
   }
 
   /**
+   * {@inheritdoc}
+   */
+  public function unflagAll(EntityInterface $entity = NULL, AccountInterface $account = NULL) {
+    $flaggings = $this->getFlaggings(NULL, $entity, $account);
+
+    /** @var \Drupal\flag\FlaggingInterface $flagging */
+    foreach ($flaggings as $flagging_id => $flagging) {
+      // We're working around the potential situation where the flagging
+      // is already gone and the unflag event won't get fired.
+      if ($entity ? $flaggable = $entity : $flaggable = $flagging->getFlaggable()) {
+        $this->unflag($flagging->getFlag(), $flaggable, $account ? $account : $flagging->get('uid')->entity);
+      }
+      else {
+        $flagging->delete();
+      }
+    }
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function userFlagRemoval(AccountInterface $account) {
+    // Remove flags by this user.
+    $this->unflagAll(NULL, $account);
+
+    // Remove flags that have been done to this user.
+    $this->unflagAll($account);
+  }
+
+  /**
    * Loads flag entities given their IDs.
    *
    * @param int[] $ids
diff --git a/src/FlagServiceInterface.php b/src/FlagServiceInterface.php
index a057566..05d55b3 100644
--- a/src/FlagServiceInterface.php
+++ b/src/FlagServiceInterface.php
@@ -8,6 +8,7 @@ namespace Drupal\flag;
 
 use Drupal\Core\Session\AccountInterface;
 use Drupal\Core\Entity\EntityInterface;
+use Drupal\user\UserInterface;
 
 /**
  * Flag service interface.
@@ -134,7 +135,8 @@ interface FlagServiceInterface {
    * @param EntityInterface $entity
    *   The entity to unflag.
    * @param AccountInterface $account
-   *   (optional) The account of the user that created the flagging.
+   *   (optional) The account of the user that created the flagging. Defaults
+   *   to the current user.
    *
    * @throws \LogicException
    *   An exception is thrown if the given flag, entity, and account are not
@@ -145,4 +147,30 @@ interface FlagServiceInterface {
    */
   public function unflag(FlagInterface $flag, EntityInterface $entity, AccountInterface $account = NULL);
 
+  /**
+   * Remove all flaggings from an entity / made by an account.
+   *
+   * If no parameters are provided, all flaggings will be removed.
+   *
+   * @param \Drupal\Core\Entity\EntityInterface|NULL $entity
+   *   (Optional) If provided, will remove all flaggings done to this entity.
+   *   If NULL, flaggings for any entity will be removed.
+   * @param \Drupal\Core\Session\AccountInterface|NULL $account
+   *   (Optional) If provided, will remove all flaggings by this account.
+   *   If NULL, flaggings for any account will be removed.
+   */
+  public function unflagAll(EntityInterface $entity = NULL, AccountInterface $account = NULL);
+
+  /**
+   * Shared helper for user account cancellation or deletion.
+   *
+   * Removes:
+   *   All flags by the user.
+   *   All flaggings of the user.
+   *
+   * @param \Drupal\Core\Session\AccountInterface $account
+   *   The account of the user being cancelled or deleted.
+   */
+  public function userFlagRemoval(AccountInterface $account);
+
 }
diff --git a/src/Tests/FlagSimpleTest.php b/src/Tests/FlagSimpleTest.php
index 83bfb02..e97adfa 100644
--- a/src/Tests/FlagSimpleTest.php
+++ b/src/Tests/FlagSimpleTest.php
@@ -7,8 +7,10 @@
 
 namespace Drupal\flag\Tests;
 
+use Drupal\node\NodeInterface;
 use Drupal\user\RoleInterface;
 use Drupal\user\Entity\Role;
+use Drupal\user\UserInterface;
 
 
 /**
@@ -170,7 +172,7 @@ class FlagSimpleTest extends FlagTestBase {
 
     $this->drupalLogin($this->adminUser);
     $edit = [
-      'global' => true,
+      'global' => TRUE,
     ];
     $this->drupalPostForm('admin/structure/flags/manage/' . $this->id, $edit, t('Save Flag'));
     $this->drupalGet('admin/structure/flags/manage/' . $this->id);
@@ -182,7 +184,7 @@ class FlagSimpleTest extends FlagTestBase {
 
     $this->drupalLogin($this->adminUser);
     $edit = [
-      'global' => false,
+      'global' => FALSE,
     ];
     $this->drupalPostForm('admin/structure/flags/manage/' . $this->id, $edit, t('Save Flag'));
     $this->drupalGet('admin/structure/flags/manage/' . $this->id);
@@ -197,38 +199,46 @@ class FlagSimpleTest extends FlagTestBase {
    * Creates user, sets flags and deletes user.
    */
   public function doUserDeletionTest() {
-    $node = $this->drupalCreateNode(['type' => $this->nodeType]);
-    $node_id = $node->id();
+    $node1 = $this->drupalCreateNode(['type' => $this->nodeType]);
+    $node2 = $this->drupalCreateNode(['type' => $this->nodeType]);
 
     // Create and login a new user.
-    $user_1 = $this->drupalCreateUser();
+    $user_1 = $this->drupalCreateUser(['delete any article content']);
     $this->drupalLogin($user_1);
 
-    $this->drupalGet('node/' . $node_id);
+    // Flag the nodes.
+    $this->drupalGet('node/' . $node1->id());
     $this->clickLink('Flag this item');
     $this->assertResponse(200);
     $this->assertLink('Unflag this item');
+    $this->drupalGet('node/' . $node2->id());
+    $this->clickLink('Flag this item');
+    $this->assertResponse(200);
 
-    $count_flags_before = \Drupal::entityQuery('flagging')
-      ->condition('uid', $user_1->id())
-      ->condition('flag_id', $this->id)
-      ->condition('entity_type', $node->getEntityTypeId())
-      ->condition('entity_id', $node_id)
-      ->count()
-      ->execute();
+    // Assert that the nodes are set to flagged.
+    $count_flags_before = $this->countFlaggings($user_1, $node1);
+    $this->assertEqual(1, $count_flags_before);
+    $count_flags_before = $this->countFlaggings($user_1, $node2);
+    $this->assertEqual(1, $count_flags_before);
 
-    $this->assertTrue(1, $count_flags_before);
+    // Delete one node.
+    $this->drupalPostForm('node/' . $node2->id() . '/delete', [], t('Delete'));
+    $this->assertResponse(200);
 
-    $user_1->delete();
+    // Assert that both nodes remain as flagged after the changes.
+    // @todo This will fail when fixing this issue https://www.drupal.org/node/2551311
+    $count_flags_before = $this->countFlaggings($user_1, $node1);
+    $this->assertEqual(1, $count_flags_before);
+    $count_flags_before = $this->countFlaggings($user_1, $node2);
+    $this->assertEqual(1, $count_flags_before);
 
-    $count_flags_after = \Drupal::entityQuery('flagging')
-      ->condition('uid', $user_1->id())
-      ->condition('flag_id', $this->id)
-      ->condition('entity_type', $node->getEntityTypeId())
-      ->condition('entity_id', $node_id)
-      ->count()
-      ->execute();
+    // Delete the user.
+    $user_1->delete();
 
+    // Ensure that all the flags are deleted.
+    $count_flags_after = $this->countFlaggings($user_1, $node1);
+    $this->assertEqual(0, $count_flags_after);
+    $count_flags_after = $this->countFlaggings($user_1, $node2);
     $this->assertEqual(0, $count_flags_after);
   }
 
@@ -320,4 +330,26 @@ class FlagSimpleTest extends FlagTestBase {
 
     $this->assertEqual(0, $count_flags_before);
   }
+
+  /**
+   * Count the number of flaggings of the user over an entity.
+   *
+   * @param UserInterface $user
+   *    The user owner of the flaggings.
+   * @param NodeInterface $node
+   *    The node flagged.
+   *
+   * @return int
+   *    Number of flags.
+   */
+  protected function countFlaggings(UserInterface $user, NodeInterface $node) {
+    return \Drupal::entityQuery('flagging')
+      ->condition('uid', $user->id())
+      ->condition('flag_id', $this->id)
+      ->condition('entity_type', $node->getEntityTypeId())
+      ->condition('entity_id', $node->id())
+      ->count()
+      ->execute();
+  }
+
 }
