The Supreme Court Wednesday upheld the appointment of Justice (retd.) R. A. Mehta as the Lokayukta of Gujarat, which is said to be a major set back for Gujarat Chief Minister Narendra Modi.