This is a very common error with babel, and is solved by removing the .aux file whenever you change languages.
When you use babel it writes information to the .aux file that refer specifically to the language you have chosen. In your case, for example, when you select swedish as the babel language it does two things: (i) it loads a set of macros related to Swedish and (ii) it (minimally) writes the following to the .aux file.
\select@language{swedish}
\@writefile{toc}{\select@language{swedish}}
\@writefile{lof}{\select@language{swedish}}
\@writefile{lot}{\select@language{swedish}}
The command \select@language{swedish} tells TeX to use the specific macros defined for Swedish.
The .aux file is used for storing information that will be reused on the next compilation. See
for some more information on this.
babel writes to the .aux file because it changes the names of things like the table of contents and list of figures according to the chosen language.
Now, when you change the language without deleting the .aux file, and compile your file, TeX reads in the .aux file and encounters the \select@language command. But since you have changed the language, the macros for Swedish haven't been loaded, and you get the error you received.
The babel package is not the only package that can sometimes require you to delete the .aux file. See the following more general question for information about them:
Newer versions of babel
If you are using an up-to-date system with babel version 3.22 or greater, you should no longer receive this error, but instead should see a warning like the following:
Package babel Warning: Unknown language `swedish'. Very likely you
(babel) requested it in a previous run. Expect some
(babel) wrong results in this run, which should vanish
(babel) in the next one. Reported on input line xxx.
.auxfile. Try that and recompile and the error should disappear. – Alan Munn Aug 08 '13 at 14:09latex. – daleif Aug 08 '13 at 14:13.auxhas been overwritten with the first compiler run and will now be read correctly. – Thorsten Donig Aug 08 '13 at 14:47.auxdepends a lot on your editing environment. With TeXShop for example, recompiling is not sufficient to remove the error. – Alan Munn Aug 08 '13 at 15:42