This trial is conducted in Europe, Oceania, Africa, Asia and South America. This trial is designed to show the effect of treatment with liraglutide when adding to existing metformin therapy and to compare it with the effects of metformin monotherapy and combination therapy of metformin and glimepiride. Two trial periods: A 6 month (26 weeks) randomised, double-blinded period followed by an 18 months open-label extension, in total 2 years (104 weeks).