diff --git a/modules/simpletest/tests/common.test b/modules/simpletest/tests/common.test
index 92aefe4..58b7d7f 100644
--- a/modules/simpletest/tests/common.test
+++ b/modules/simpletest/tests/common.test
@@ -1513,6 +1513,28 @@ class JavaScriptTestCase extends DrupalWebTestCase {
    * Test the 'javascript_always_use_jquery' variable.
    */
   function testJavaScriptAlwaysUseJQuery() {
+    // Create an admin user.
+    $this->admin_user = $this->drupalCreateUser(array('administer site configuration'));
+    $this->drupalLogin($this->admin_user);
+
+    // Ensure that 'javascript_always_use_jquery' variable is set and unset
+    // correctly via the UI, since there is special code to make the checkbox
+    // value the opposite of the variable value.
+    // When the checkbox is selected the variable value should be FALSE.
+    $edit = array();
+    $edit['javascript_always_use_jquery'] = TRUE;
+    $this->drupalPost('admin/config/development/performance', $edit, t('Save configuration'));
+    $value = variable_get('javascript_always_use_jquery');
+    $this->assertTrue(isset($value) && $value == FALSE, 'When the checkbox is selected, the "javascript_always_use_jquery" value is FALSE.');
+    variable_del('javascript_always_use_jquery');
+    // When the checkbox is not selected the variable value should be TRUE.
+    $edit = array();
+    $edit['javascript_always_use_jquery'] = FALSE;
+    $this->drupalPost('admin/config/development/performance', $edit, t('Save configuration'));
+    $value = variable_get('javascript_always_use_jquery');
+    $this->assertTrue(isset($value) && $value == TRUE, 'When the checkbox is not selected, the "javascript_always_use_jquery" value is TRUE.');
+    variable_del('javascript_always_use_jquery');
+
     // The default front page of the site should use jQuery and other standard
     // scripts and settings.
     $this->drupalGet('');
diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc
index 8ef7d7c..4b40c2c 100644
--- a/modules/system/system.admin.inc
+++ b/modules/system/system.admin.inc
@@ -1762,12 +1762,19 @@ function system_performance_settings() {
     '#default_value' => intval(variable_get('preprocess_js', 0) && $is_writable),
     '#disabled' => $disabled,
   );
+  $form['bandwidth_optimization']['javascript_always_use_jquery'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Skip loading jQuery when it will not be used.'),
+    '#default_value' => !variable_get('javascript_always_use_jquery', TRUE),
+    '#description' => '<em class="jquery-warning">'. t('Warning: This may break sites that include JavaScript directly via &lt;script&gt; tags in the theme or in content.') . '</em>',
+  );
 
   $form['#submit'][] = 'drupal_clear_css_cache';
   $form['#submit'][] = 'drupal_clear_js_cache';
   // This form allows page compression settings to be changed, which can
   // invalidate the page cache, so it needs to be cleared on form submit.
   $form['#submit'][] = 'system_clear_page_cache_submit';
+  $form['#submit'][] = 'system_flip_javascript_always_use_jquery';
 
   return system_settings_form($form);
 }
@@ -1792,6 +1799,15 @@ function system_clear_page_cache_submit($form, &$form_state) {
 }
 
 /**
+ * Submit callback; flip the javascript_always_use_jquery variable on submit.
+ *
+ * @ingroup forms
+ */
+function system_flip_javascript_always_use_jquery($form, &$form_state) {
+  $form_state['values']['javascript_always_use_jquery'] = !$form_state['values']['javascript_always_use_jquery'];
+}
+
+/**
  * Form builder; Configure the site file handling.
  *
  * @ingroup forms
