diff --git a/admin/settings/language.php b/admin/settings/language.php
index ea155e2..293b1d6 100644
--- a/admin/settings/language.php
+++ b/admin/settings/language.php
@@ -5,6 +5,7 @@
 // "languageandlocation" settingpage
 $temp = new admin_settingpage('langsettings', get_string('languagesettings', 'admin'));
 $temp->add(new admin_setting_configselect('lang', get_string('lang', 'admin'), get_string('configlang', 'admin'), current_language(), get_list_of_languages())); // $CFG->lang might be set in installer already, default en or en_utf8 is in setup.php
+$temp->add(new admin_setting_configcheckbox('langbrowser', get_string('langbrowser', 'admin'), get_string('configlangbrowser', 'admin'), 1));
 $temp->add(new admin_setting_configcheckbox('langmenu', get_string('langmenu', 'admin'), get_string('configlangmenu', 'admin'), 1));
 $temp->add(new admin_setting_langlist());
 $temp->add(new admin_setting_configcheckbox('langcache', get_string('langcache', 'admin'), get_string('configlangcache', 'admin'), 1));
diff --git a/lang/en_utf8/admin.php b/lang/en_utf8/admin.php
index d7d25ea..2e61357 100644
--- a/lang/en_utf8/admin.php
+++ b/lang/en_utf8/admin.php
@@ -117,6 +117,7 @@ $string['configintrosite'] = 'This page allows you to configure the front page a
 $string['configintrotimezones'] = 'This page will search for new information about world timezones (including daylight savings time rules) and update your local database with this information.  These locations will be checked, in order: $a This procedure is generally very safe and can not break normal installations.  Do you wish to update your timezones now?';
 $string['configiplookup'] = 'When you click on an IP address (such as 34.12.222.93), such as in the logs, you are shown a map with a best guess of where that IP is located.  There are different plugins for this that you can choose from, each has benefits and disadvantages.';
 $string['configlang'] = 'Choose a default language for the whole site.  Users can override this setting later.';
+$string['configlangbrowser'] = 'If you prefer setting the default language based on the browser language configuration, enable this. If you leave it empty, the language specified above will be used.';
 $string['configlangcache'] = 'Cache the language menu. Saves a lot of memory and processing power. If you enable this, the menu takes a few minutes to update after you have added or removed languages.';
 $string['configlangdir'] = 'Most languages are printed left-to-right, but some, like Arabic and Hebrew, are printed right-to-left.';
 $string['configlanglist'] = 'Leave this blank to allow users to choose from any language you have in this installation of Moodle.  However, you can shorten the language menu by entering a comma-separated list of language codes that you want.  For example:  en,es_es,fr,it';
@@ -334,6 +335,7 @@ $string['invaliduserchangeme'] = 'Username \"changeme\" is reserved -- you canno
 $string['iplookup'] = 'IP address lookup';
 $string['lang'] = 'Default language';
 $string['lang16notify'] = 'Moodle 1.6 and above allows you to install and update language packs directly from download.moodle.org by following the link below';
+$string['langbrowser'] = 'Prefer browser language';
 $string['langcache'] = 'Cache language menu';
 $string['langedit'] = 'Language editing';
 $string['langimport'] = 'Language import utility';
diff --git a/lib/moodlelib.php b/lib/moodlelib.php
index bac5fed..427c0b7 100644
--- a/lib/moodlelib.php
+++ b/lib/moodlelib.php
@@ -6957,6 +6957,11 @@ function setup_lang_from_browser() {
         return;
     }
 
+    if (empty($CFG->langbrowser)) {
+        // We prefer configured site default language over browser language.
+        return;
+    }
+
     if (!isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { // There isn't list of browser langs, nothing to do
         return;
     }
