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 33e0df1..c6fe964 100644
--- a/lang/en_utf8/admin.php
+++ b/lang/en_utf8/admin.php
@@ -123,6 +123,7 @@ $string['configintrotimezones'] = 'This page will search for new information abo
 $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['configkeeptagnamecase'] = 'Check this if you want tag names to keep the original casing as entered by users who created them';
 $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';
@@ -365,6 +366,7 @@ $string['iplookup'] = 'IP address lookup';
 $string['keeptagnamecase'] = 'Keep tag name casing';
 $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 2d9b13c..85c0500 100644
--- a/lib/moodlelib.php
+++ b/lib/moodlelib.php
@@ -7159,6 +7159,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;
     }
