Aerobraking
The Mars Global Surveyor reached Mars in September of 1997. But it didn't make it into its final mapping orbit until February 1999. What took so long?Surveyor needed to reach a near-circular, low-altitude orbit in order to map the surface of Mars. In September 1997, the orbit of MGS was far from circular and at its farthest point in orbit, MGS was really far from Mars (56,000 kilometers above the surface)! Mission controllers needed MGS to be only ~400 kilometers above the surface. In order to adjust the orbit of MGS, the controllers used aerobraking.
Controllers were going to send MGS through the atmosphere of Mars to slow it down. During these atmospheric passes, air resistance generated by the solar panels would slow the spacecraft and gradually lower its orbit. Surveyor was to use this aerobraking technique to lower the high point of its orbit from the initial 56,000 kilometers in altitude to about 400 kilometers. This aerobraking would also force the spacecraft into a near-circular orbit. Originally, this was only suppose to take 4 months.
Unfortunately, one of the solar panels (which are used during aerobraking!) broke during the launch of MGS. This solar panel got stuck and wouldn't open all the way. Controllers had to pay special attention to this broken solar panel. But, it was decided that aerobraking could still be used...only things would need to go much slower! That is why it took so long for MGS to reach its correct orbit for mapping.
Aerobraking was started in September 1998 and lasted until early February 1999 - that's almost 700 orbits around the planet! But, finally the mapping orbit was reached on February 4, 1999. Aerobraking was completed on that day and MGS was pulled up out of the atmosphere for good. In 2001, the spacecraft's altitude has ranged from about 310 km - 430 km.