Pyelonephritis is caused by a bacterium or virus infecting the kidneys. Though many bacteria and viruses can cause pyelonephritis, the bacterium Escherichia coli is often the cause. Bacteria and viruses can move to the kidneys from the bladder or can be carried through the bloodstream from other parts of the body. A UTI in the bladder that does not move to the kidneys is called cystitis.