Reversing a nearly 40-year-old ban, Japan's parliament voted on Wednesday to allow the nation's space programs to be used for national defence.

The country' upper house of parliament approved the legislation with a 221 to 14 vote, seconding an earlier approval by the lower house and lifting a ban on the military use of space in place since 1969.

The law gives Japan's military greater freedom to develop advanced spy satellites for intelligence and allows the country to pursue a joint missile defence shield with the United States.

The law requires that space programs be used for defence only and that they "contribute to establish a safe society, remove various threats to life of the people and ensure peace and safety of international society, as well as the national security of our country."

Under the new measure, Japan's defence minister will join a special task force responsible for overseeing Japan's future space projects.

Japan is prohibited from offensive war by its U.S.-drafted 1947 constitution. But the country has begun to relax its controls on the military, upgrading the Defence Agency to ministry status last year.

Its space program has also been historically focused on peaceful endeavours such as research and communications. Japan launched its first satellite in 1970 and has achieved several major scientific coups in space, including launching a probe that collected samples from an asteroid.

But starting with the launch of its first spy satellite in 2003, Japan has been increasing its presence in space, partly in response to a perceived nuclear threat from Communist North Korea.

It has since launched three other intelligence-gathering satellites.