The effect of the surface treatments on the transport properties of a two-dimensional electron gas was studied at the quantum limit. The surface of the Al 0.36 Ga 0.64 As/ GaAs heterostructure was either coated with gold or etched with HCl solution, or etched and then coated by a self-assembled monolayer ͑SAM͒ of either phosphonated ͑ODP-C 18 H 39 PO 3 ͒ or thiolated ͑ODT-C 18 H 37 S͒ molecules. The etching process was found to reduce significantly both the mobility and the charge density. This effect was reversed upon sequential adsorption of the phosphonated SAM. We propose fine tuning of the device performance by the flexible chemistry of the assembled molecules, two of them demonstrated here. The results indicate that the surface oxidation does not necessarily play the dominant role in this respect and, in particular, that octadecane phosphonic acid ͑ODP͒ can protect the substrate from both oxidation and the formation of a passivating carbon layer. In contrast, octadecanethiol ͑ODT͒ is not stable enough and is not effective in eliminating surface states, as a result devices covered with ODT behave like those with etched surfaces.