A magnetic catheter has a flexible tube having a lumen communicating with a balloon, the balloon located near a distal end of the tube and a nonuniform magnetic portion located near, but proximal to, the balloon. The tube is adapted to insertion into bodily orifices like a male urethra, the lumen extending from balloon to proximal end and configured such that injection of fluid into the first lumen can inflate the balloon. The nonuniform magnetic portion has a sequence of magnetically permeable objects, or a sequence of permanent magnets, to provide magnetic field gradients to the prostate, or in alternative embodiment the pancreas. The catheter is used to treat the organ by applying a nonuniform magnetic field to the organ while magnetic nanoparticles are injected into the patient where they concentrate in the nonuniform magnetic field. An AC magnetic field is applied to the magnetic nanoparticles to heat the organ.