diff --git includes/menu.inc includes/menu.inc
index 642e946..b086dc7 100644
--- includes/menu.inc
+++ includes/menu.inc
@@ -1095,6 +1095,38 @@ function menu_tree_all_data($menu_name, $link = NULL, $max_depth = NULL) {
 }
 
 /**
+ * Set the active item for the specified menu tree.
+ *
+ * @param $menu_name
+ *   The name of the affected menu tree.
+ * @param $item
+ *   A menu item with array keys like those returned by menu_get_item().
+ */
+function menu_tree_set_item($menu_name, $item) {
+  return menu_tree_get_item($menu_name, $item);
+}
+
+/**
+ * Get the active item for the requested menu tree.
+ *
+ * @param $menu_name
+ *   The menu name of the requested tree.
+ * @param $item
+ *   Internal use only.
+ *
+ * @return
+ *   A menu item with array keys like those returned by menu_get_item(). If no
+ *   menu item has been specified with menu_tree_set_item(), NULL is returned.
+ */
+function menu_tree_get_item($menu_name, $item = NULL) {
+  $items = &drupal_static(__FUNCTION__);
+  if (isset($item)) {
+    $items[$menu_name] = $item;
+  }
+  return isset($items[$menu_name]) ? $items[$menu_name] : NULL;
+}
+
+/**
  * Get the data structure representing a named menu tree, based on the current page.
  *
  * The tree order is maintained by storing each parent in an individual
@@ -1119,8 +1151,11 @@ function menu_tree_all_data($menu_name, $link = NULL, $max_depth = NULL) {
 function menu_tree_page_data($menu_name, $max_depth = NULL, $only_active_trail = FALSE) {
   $tree = &drupal_static(__FUNCTION__, array());
 
+  // Check if the active item has been overridden for this menu tree.
+  $item = menu_tree_get_item($menu_name);
+  $item_path = isset($item['href']) ? $item['href'] : NULL;
   // Load the menu item corresponding to the current page.
-  if ($item = menu_get_item()) {
+  if ($item || ($item = menu_get_item())) {
     if (isset($max_depth)) {
       $max_depth = min($max_depth, MENU_MAX_DEPTH);
     }
@@ -1159,8 +1194,9 @@ function menu_tree_page_data($menu_name, $max_depth = NULL, $only_active_trail =
         // If the item for the current page is accessible, build the tree
         // parameters accordingly.
         if ($item['access']) {
-          // Find a menu link corresponding to the current path.
-          if ($active_link = menu_link_get_preferred()) {
+          // Find a menu link corresponding to the current path. If $item_path
+          // is NULL, let menu_link_get_preferred() determine the path.
+          if ($active_link = menu_link_get_preferred($item_path)) {
             // The active link may only be taken into account to build the
             // active trail, if it resides in the requested menu. Otherwise,
             // we'd needlessly re-run _menu_build_tree() queries for every menu
diff --git modules/simpletest/tests/menu.test modules/simpletest/tests/menu.test
index 0c002e2..36d9e0a 100644
--- modules/simpletest/tests/menu.test
+++ modules/simpletest/tests/menu.test
@@ -560,6 +560,43 @@ class MenuTreeDataTestCase extends DrupalUnitTestCase {
 }
 
 /**
+ * Menu tree display related tests.
+ */
+class MenuTreeTestCase extends DrupalWebTestCase {
+  public static function getInfo() {
+    return array(
+      'name' => 'Menu tree display',
+      'description' => 'Tests menu tree display functions.',
+      'group' => 'Menu',
+    );
+  }
+
+  /**
+   * Test the menu_tree_set_item() affects menu tree generation.
+   */
+  function testMenuTreeSetItem() {
+    $path = 'admin/config/system/site-information';
+    $menu = 'management';
+
+    // Verify the test path is not originally in the menu tree.
+    $tree = drupal_render(menu_tree($menu));
+    $this->assert(strpos($tree, $path) === FALSE, t('Test link does not exist in menu tree.'));
+
+    // Set the active menu tree item to the test path.
+    drupal_flush_all_caches();
+    $item = menu_get_item($path);
+    menu_tree_set_item($menu, $item);
+
+    // Check if the menu item is returned by menu_tree_get_item().
+    $this->assertIdentical($item, menu_tree_get_item($menu), t('Test link set by menu_tree_set_item().'));
+
+    // Check if the test path is in the menu tree.
+    $tree = drupal_render(menu_tree($menu));
+    $this->assert(strpos($tree, $path) !== FALSE, t('Test link exists in menu tree.'));
+  }
+}
+
+/**
  * Menu breadcrumbs related tests.
  */
 class MenuBreadcrumbTestCase extends DrupalWebTestCase {
