Three Chinese astronauts docked with the country’s still-under-construction space station Thursday, starting what their government expects, expecting Chinese astronauts to be present in Earth orbit for a decade or more.

Six hours and 32 minutes after the astronauts took off from a base in the Gobi Desert on a clear, sunny morning, their Shenzhou-12 spacecraft docked with the station’s core module.

“It was a perfect rendezvous and docking process,” Sun Jun, deputy director of Beijing Aerospace Flight Control Center, told state broadcaster CCTV, adding that so far the mission has “fully achieved our original goal.”

This made the Chinese station Tiangong or Heavenly Palace one of two populated outposts in orbit. The other, the International Space Station, has been in operation for more than two decades, but its future is uncertain due to age, budget constraints, and tensions between its main partners, the United States and Russia.

The Chinese space program has no such problems building its station independently, although it has invited other countries to contribute experiments and may welcome foreign astronauts in the future.

The completion of Tiangong, expected by the end of next year, will mark another milestone in an ambitious space program whose recent missions include returning samples from the moon and landing a robotic rover on Mars.

Thursday’s launch was broadcast live on Chinese state television, reflecting the growing confidence that top officials have in the space program. Their missions have often been shrouded in military secrecy, presumably in some cases at least for fear that something might go wrong. Images from the recent Mars mission have not been published for days.

Before the start on Thursday, however, the Chinese space agency arranged briefings for selected news organizations as well as interviews with the astronauts who were escorted by a motorcycle guard through flag-waving streets to the launch site shortly after daybreak.

“It feels great,” said the mission’s commander, Maj. Gen. Nie Haisheng, in a video showing him and the others preparing to board the Shenzhou-12 on Thursday morning. “My heart flies, march bravely forward.”

High-ranking politicians and military officials observed them from the space launch center near Jiuquan, a town on the edge of the Gobi, near the Chinese border with Mongolia. Including Han Zheng, one of seven members of the Standing Committee of the Politburo, the highest governing body of the Communist Party led by Xi Jinping, the country’s top leader.

In contrast to his predecessor Hu Jintao, who witnessed the beginning of China’s first manned space flight from 2003, Mr. Xi did not take part. The string of successful space missions in the country has been recognized by officials and state media as confirmation of the Communist Party’s rule in China and the position of Mr. Xi at the helm.

All three astronauts are party members, and they and other space officials repeatedly credited Mr. Xi or the party with the country’s accomplishments in space. Several officials stated that the mission coincided with the 100th anniversary of the Chinese Communist Party’s official establishment in Shanghai on July 1, 1921.

“The construction and operation of the space station can be seen as an important symbol of a country’s economic, technological and comprehensive strength,” said Ji Qiming, an assistant to the director of the China Manned Space Agency, at a pre-launch briefing.

The three astronauts are China’s first in space since 2016. It is only China’s seventh crewed mission, but more are to come. Three more launches will bring astronauts to the space station over the next year and a half to complete construction.

China launched the station’s main module in April and docked a cargo ship on it a month later. Shenzhou-12, a ship modeled after the Soyuz capsules from the Soviet era, consists of three modules, including a re-entry ship that will bring the astronauts back to Earth.

The rest of the Shenzhou-12 effectively becomes a third part of the space station, which orbits 242 miles or 390 kilometers above Earth, slightly lower than the International Space Station at 248 miles.

The astronauts will spend three months in space. With the station still under construction, the astronauts’ main job is essentially moving in, starting installing equipment such as cameras, and testing various functions, including life support and waste management. You’re supposed to do two spacewalks.

The commander, General Nie, of the People’s Liberation Army Astronaut Brigade, is a former fighter pilot and a veteran of two previous Shenzhou missions in 2005 and 2013. At a briefing with journalists on Wednesday, he said the mission would be more arduous and challenging than the first.

“Not only will we need to set up the core module, the Space Home,” he said, “we will also do a number of key technology reviews.”

At 56, he is the oldest Chinese astronaut to fly in space. (The oldest person to ever do this was John Glenn, the first American in orbit, who returned aboard the space shuttle Discovery 36 years later at the age of 77 in 1998.)

Another crew member, Maj. Gen. Liu Boming, 54, is also a space veteran who was part of a 2008 mission that included China’s first space walk. This feat was accomplished by another astronaut, Zhai Zhigang, but General Liu briefly emerged from a portal to become the second Chinese astronaut to wander in space. The third astronaut, Col. Tang Hongbo, 45, is on his first trip after 11 years of training.

China launched two short-lived prototype space stations, also known as Tiangong, in 2011 and 2016. This is said to be more durable and serve as a revolving laboratory for the country’s space program for the next decade.

Officials said the station would enable Chinese astronauts and scientists on the ground to perfect complex operations and conduct experiments in the weightless space environment. International partners have so far been involved in at least nine planned experiments.

While federal law bans NASA from collaborating with China in space, Bill Nelson, the agency’s administrator, congratulated China in a statement Thursday. He added that he was looking forward to “the scientific discoveries to come”.

Officials said that after the station was completed, they would consider bringing foreign astronauts to the station.

Mr. Ji, the deputy director of the space agency, admitted at a briefing that China was “lagging behind” in building orbiting space stations that the United States and the Soviet Union reached decades ago. However, China benefits from “latecomer advantages”.

The Tiangong is being built at a time when Russia and the US are arguing about the future of the International Space Station and China and Russia are working more closely together on space exploration.

The International Space Station was originally scheduled to retire in 2015, just four years after construction was completed, but its lifespan was subsequently extended to 2020 and then to 2024. The bill recently passed in the United States Senate provides for a further extension to 2030.

In 2018, President Donald J. Trump’s administration said it would end direct federal funding for the station after 2024 and move orbital operations to private space stations. However, after criticizing this decision, NASA officials insisted it was not a set deadline. A feasibility study by NASA concluded that the aging space station could continue to run at least in 2028, although Russia has signaled that it could consider getting out of the project by then.

Claire Fu contributed to the research.