diff --git a/core/core.services.yml b/core/core.services.yml
index 7d56112..d3210f2 100644
--- a/core/core.services.yml
+++ b/core/core.services.yml
@@ -316,6 +316,11 @@ services:
     tags:
       - { name: paramconverter }
     arguments: ['@entity.manager']
+  route_subscriber.module:
+    class: Drupal\Core\EventSubscriber\ModuleRouteSubscriber
+    tags:
+      - { name: event_subscriber }
+    arguments: ['@module_handler']
   route_subscriber.entity:
     class: Drupal\Core\EventSubscriber\EntityRouteAlterSubscriber
     tags:
diff --git a/core/lib/Drupal/Core/EventSubscriber/ModuleRouteSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/ModuleRouteSubscriber.php
new file mode 100644
index 0000000..1cf7a20
--- /dev/null
+++ b/core/lib/Drupal/Core/EventSubscriber/ModuleRouteSubscriber.php
@@ -0,0 +1,60 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Core\EventSubscriber\ModuleRouteSubscriber.
+ */
+
+namespace Drupal\Core\EventSubscriber;
+
+use Drupal\Core\Extension\ModuleHandlerInterface;
+use Drupal\Core\Routing\RouteBuildEvent;
+use Symfony\Component\EventDispatcher\EventSubscriberInterface;
+use Drupal\Core\Routing\RoutingEvents;
+
+/**
+ * A route subscriber for altering routes based on module data.
+ */
+class ModuleRouteSubscriber implements EventSubscriberInterface {
+
+  /**
+   * The module handler.
+   *
+   * @var \Drupal\Core\Extension\ModuleHandlerInterface
+   */
+  protected $moduleHandler;
+
+  /**
+   * Constructs a ModuleRouteSubscriber object.
+   *
+   * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
+   *   The module handler.
+   */
+  public function __construct(ModuleHandlerInterface $module_handler) {
+    $this->moduleHandler = $module_handler;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function getSubscribedEvents() {
+    $events[RoutingEvents::ALTER] = 'removeRoutes';
+    return $events;
+  }
+
+  /**
+   * Removes any routes that have an unmet module dependency.
+   *
+   * @param \Drupal\Core\Routing\RouteBuildEvent $event
+   *   The route building event.
+   */
+  public function removeRoutes(RouteBuildEvent $event) {
+    $collection = $event->getRouteCollection();
+    foreach ($collection as $name => $route) {
+      if ($route->hasRequirement('_module_dependency') && !$this->moduleHandler->moduleExists($route->getRequirement('_module_dependency'))) {
+        $collection->remove($name);
+      }
+    }
+  }
+
+}
diff --git a/core/tests/Drupal/Tests/Core/EventSubscriber/ModuleRouteSubscriberTest.php b/core/tests/Drupal/Tests/Core/EventSubscriber/ModuleRouteSubscriberTest.php
new file mode 100644
index 0000000..20f476c
--- /dev/null
+++ b/core/tests/Drupal/Tests/Core/EventSubscriber/ModuleRouteSubscriberTest.php
@@ -0,0 +1,80 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Tests\Core\EventSubscriber\ModuleRouteSubscriberTest.
+ */
+
+namespace Drupal\Tests\Core\EventSubscriber;
+
+use Drupal\Core\Routing\RouteBuildEvent;
+use Drupal\Tests\UnitTestCase;
+use Drupal\Core\EventSubscriber\ModuleRouteSubscriber;
+use Symfony\Component\Routing\RouteCollection;
+use Symfony\Component\Routing\Route;
+
+/**
+ * Tests the ModuleRouteSubscriber class.
+ *
+ * @see \Drupal\Core\EventSubscriber\ModuleRouteSubscriber
+ */
+class ModuleRouteSubscriberTest extends UnitTestCase {
+
+  /**
+   * The mock module handler.
+   *
+   * @var Drupal\Core\Extension\ModuleHandlerInterface|\PHPUnit_Framework_MockObject_MockObject
+   */
+  protected $moduleHandler;
+
+  public static function getInfo() {
+    return array(
+      'name' => 'Module route subscriber',
+      'description' => 'Unit test the \Drupal\Core\EventSubscriber\ModuleRouteSubscriber class.',
+      'group' => 'System'
+    );
+  }
+
+  /**
+   * Tests that removeRoute() removes routes when the module is not enabled.
+   */
+  public function testRemoveRoute() {
+    $module_handler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface');
+    // Should only get called for 2 of the 3 routes.
+    $module_handler->expects($this->exactly(2))
+      ->method('moduleExists')
+      ->will($this->returnCallback(array($this, 'moduleExistsCallback')));
+
+    $collection = new RouteCollection();
+    $route_1 = new Route('', array(), array('_module_dependency' => 'enabled'));
+    $collection->add('enabled', $route_1);
+    $route_2 = new Route('module_disabled', array(), array('_module_dependency' => 'disabled'));
+    $collection->add('disabled', $route_2);
+    $route_3 = new Route('no_module_dependency', array(), array());
+    $collection->add('no_module_dependency', $route_3);
+
+    $event = new RouteBuildEvent($collection, 'test');
+    $route_subscriber = new ModuleRouteSubscriber($module_handler);
+    $route_subscriber->removeRoutes($event);
+
+    $this->assertInstanceOf('Symfony\Component\Routing\Route', $collection->get('enabled'));
+    $this->assertNull($collection->get('disabled'));
+    $this->assertInstanceOf('Symfony\Component\Routing\Route', $collection->get('no_module_dependency'));
+  }
+
+  /**
+   * Test return callback for mock moduleExists callback.
+   *
+   * @param string $dependency
+   *   The name of the module dependency.
+   *
+   * @return bool
+   *   A boolean representing whether or not a module exists.
+   *
+   * @see testRemoveRoute()
+   */
+  public function moduleExistsCallback($dependency) {
+    return $dependency == 'enabled';
+  }
+
+}
