diff --git a/pathauto_paths.module b/pathauto_paths.module
index 987df67..0ad0b15 100644
--- a/pathauto_paths.module
+++ b/pathauto_paths.module
@@ -128,3 +128,26 @@ function pathauto_paths_load($id) {
     ->fetchAssoc();
   return $record;
 }
+
+/**
+ * Implements hook_entity_delete().
+ */
+function pathauto_paths_entity_delete($entity, $type) {
+  $info = entity_get_info($type);
+  if (empty($info['entity keys']['bundle'])) {
+    return;
+  }
+  $entity_id = $entity->{$info['entity keys']['id']};
+  $sources = array();
+  $result = db_select('pathauto_paths', 'pp')
+    ->fields('pp')
+    ->condition('entity_type', $type)
+    ->condition('bundle', $entity->{$info['entity keys']['bundle']})
+    ->execute();
+  foreach ($result as $row) {
+    $sources[] = str_replace('%', $entity_id, $row->router_path);
+  }
+  db_delete('url_alias')
+    ->condition('source', $sources)
+    ->execute();
+}
