diff --git a/admin_menu.module b/admin_menu.module
index 02c98f6..870da5c 100644
--- a/admin_menu.module
+++ b/admin_menu.module
@@ -530,7 +530,7 @@ function admin_menu_output($complete = FALSE) {
     // name clashes with the contributed Admin module.
     drupal_alter('admin_menu_output', $content);
 
-    $content = drupal_render($content);
+    $content = \Drupal::service($content);
 
     // Cache the menu for this user.
     if ($cache_server_enabled) {
@@ -647,7 +647,7 @@ function theme_admin_menu_links($variables) {
     );
     // Render children to determine whether this link is expandable.
     if (isset($elements[$path]['#type']) || isset($elements[$path]['#theme']) || isset($elements[$path]['#pre_render'])) {
-      $elements[$path]['#children'] = drupal_render($elements[$path]);
+      $elements[$path]['#children'] = \Drupal::service($elements[$path]);
     }
     else {
       $elements[$path]['#children'] = theme('admin_menu_links', array('elements' => $elements[$path]));
