The final mission, STS-125/SM4 (servicing mission 4), was done to prolong the life of the telescope. During the 12-day mission, they installed two (2) new instruments and performed two (2) repairs of failed equipment, and six new batteries in addition to replacing gyroscopes. This expected to extend Hubble’s lifespan by five (5) years from 2009.[2] So we were looking at an expected 2014 EOL date.
The 2009 mission was an interesting event in itself with Hubble’s durability aside. During a talk from Dr. Andrew Fuestel, he mentioned how NASA developed specialized tools for him to repair Hubble mid-orbit—which he said were the scariest times of his life—during his three (3) spacewalks.
[1] https://asd.gsfc.nasa.gov/archive/hubble/missions/sm4.html
[2]http://www.cbsnews.com/network/news/space/home/spacenews/fil...