Russia and China have signed an agreement to build and work on an “International Scientific Lunar Station” orbiting the Moon, the countries’ space agencies announced Tuesday. The space powers had been in talks for months as Russia mulled over whether it would participate in NASA’s Gateway program, a rival lunar space station to be built by a coalition of other countries in the next decade.

The International Scientific Lunar Station that Russia and China will work on is “a complex of experimental research facilities created on the surface and/or in the orbit of the Moon,” Roscosmos, Russia’s space agency, said in a statement. It will be designed to support a variety of research experiments “with the possibility of long-term unmanned operation with the prospect of a human presence on the moon,” the statement said.

Like NASA, China has been courting international support for its own plans to put infrastructure on the Moon. It’s also sent several robotic Chang’e missions to the Moon, including the first landing on the Moon’s far side and a swift sample retrieval mission in December.

The lunar space station agreement, signed virtually between China’s space chief Zhang Kejian and Russia’s space chief Dmitry Rogozin, marks the latest development in Beijing’s efforts to explore the Moon alongside rivals like NASA, which is barred from working with China under a law passed by Congress in 2011.

Russia, which has maintained a decades-long partnership with NASA on the International Space Station, has been reluctant to extend its space alliance with the US to the Moon.

NASA stepped up its push to return astronauts on the Moon under the Trump administration through its Artemis program. Part of that push involved spearheading a multilateral pact called the Artemis Accords, an effort to set standards of behavior in space. Nine other countries have signed the Artemis Accords so far, but Russia is not among them, after the US sought to exclude Moscow from early talks on the Accords last year.

NASA secured agreements with the European Space Agency, Japan, and Canada for work on its Lunar Gateway, the planned space station orbiting the Moon. NASA did ask Russia to be a part of building that station, but Moscow decided that NASA’s request for Russia to provide an airlock for Gateway was “impractical,” a Roscosmos spokesperson said in December.

“NASA presented the Russian-American Memorandum of Understanding to Roscosmos concerning the cooperation within the Gateway project. The MoU suggested that Roscosmos commits to provide a crew airlock module,” the spokesperson said. “After studying the draft document, the participation of the Russian side to the volume suggested by the US partners was deemed impractical.”

Russia soon pivoted its attentions to China’s lunar ambitions. Cooperating with China became one of Russia’s “top priorities” last year, the spokesperson said.

NASA and Roscosmos officials continued discussions for working on Gateway even as Rogozin publicly slammed NASA’s Artemis program, with the US remaining hopeful Russia would eventually agree to supply an airlock — an element that would be installed around 2028. But after Russia and China announced their moon agreement, NASA said in a statement to ThinkAuthority it “will be pursuing other options for the provider of the airlock,” and that Gateway planning for the piece’s 2028 launch “remains unchanged.”

“While Roscosmos has informed NASA that it does not wish to be part of the Gateway partnership at this time, they did offer to continue exploring interoperability and we welcome such a discussion,” NASA spokeswoman Monica Witt said.

The Russia-China agreement greenlights joint development of their own lunar space station, which calls for “planning, demonstration, design, development, implementation, and operation of scientific research station projects, including project promotion to the international aerospace community,” a statement from the China National Space Administration said.

It was unclear what specific technical contributions would be made by Russia, whose military-civil space agency has been investing in new launch infrastructure despite a domestic climate of budgetary rollbacks. Russia’s space budget ranks third globally, behind the United States and China.

China also held talks with France’s space agency CNES as a “status check of the bilateral space cooperation between the two agencies,” CNES said on Tuesday. Among cooperation on climate science, Beijing’s Kejian and France’s space chief Jean-Yves Le Gall also discussed “other potential areas for cooperation in relation to the Moon and Mars,” the statement said.