We have developed a reliable lithographic method to pattern thin gold films by locally exposing a thin layer of an electron beam resist with the tip of a scanning tunneling microscope (STM). The exposure of the resist layer is induced by applying a voltage difference of ca. -10V between the STM tip and the gold film on top of which the resist layer has been deposited with the Langmuir-Blodgett technique. Our resist material is omega-tricosenoic acid which acts as a negative resist. After development, the unexposed areas of the gold film can be removed via argon ion milling. We have been able to obtain continuous gold lines having a width down to 15 nm, the linewidth being determined by the exposure dose. When reducing the tunneling voltage <5 V, exposure of the Langmuir-Blodgett resist layer no longer occurs and one switches to the classical topographic imaging mode. This switching provides us with the unique possibility to attach electrical contacts to existing nanostructures. As a nice example of this nanowire bonding, gold contacts have been attached to individual multiwalled carbon nanotubes. We have made detailed measurements of the nanotube resistance as a function of temperature down to 10 mK and in magnetic fields up to 14 T. Al low temperatures a pronounced negative magnetoresistance is observed which is consistent with the two-dimensional weak electron localization occurring in the cylindrical graphite layers forming the nanotubes. The nanotubes also show reproducible fluctuations of the magnetoresistance which can be related to the Aharonov-Bohm effect in the nanotubes. (C) 1997 Elsevier Science B.V.