NASA tested the deployment and tension of the five-layer sun shield, which will protect the James Webb Space Telescope once it is in orbit.

NASA's James Webb Space Telescope has reached a major milestone with a successful test of the spacecraft's sun shield.

Engineers fully deployed and tensioned each of the five layers of the sun shield, which will protect the telescope from the sun's powerful radiation and, in turn, help regulate the temperature of Webb's optics and sensors . As part of the test, the sun shield was extended to the same position it will be in when it is 1 million miles from Earth, according to a statement from NASA.

"This was the first time that the sun shield has been deployed and tensioned by the spacecraft electronics and with the telescope present above it," James Cooper, NASA's Webb Telescope sun shield manager at NASA's Goddard Space Flight Center in Maryland, said in the statement . "The deployment is visually stunning as a result, and it was challenging to accomplish."

Related: Building the James Webb Space Telescope (Gallery)

The James Webb telescope is expected to launch in March 2021. The tennis court-size sun shield consists of five layers that are each coated in a vapor-deposited aluminum substance to reflect the sun's heat into space, according to the statement.

Testing the sun shield's deployment helps ensure that it will function successfully once in orbit. In order to simulate the lack of gravity that the spacecraft will experience, NASA technicians used gravity-offsetting pulleys and weights.

"This test showed that the sunshield system survived spacecraft element environmental testing, and taught us about the interfaces and interactions between the telescope and sunshield parts of the observatory," Cooper said in the statement. "Many thanks to all the engineers and technicians for their perseverance, focus and countless hours of effort to achieve this milestone."

When deployed, the sun shield separates the space observatory into a warm side that always faces the sun and a cold side that always faces deep space. Following the successful deployment, NASA team members will start folding the sun shield back into its stowed position, according to the statement.

Next, the spacecraft will undergo electrical and mechanical tests to simulate the vibration environment it will endure during launch. Then, the telescope has just one final deployment and stowing cycle before it launches to space.