SHANGHAI — China’s commercial aerospace dreams took wing on Friday, as the first Chinese-built passenger jetliner completed its first public flight test, embodying the country’s ambitions to take on the industry champions, Boeing and Airbus.

With a brisk breeze blowing through light smog under overcast skies, a large crowd of government officials and aerospace executives gathered to watch as the C919, white with a green-and-blue striped tail, underwent a lengthy preflight check, then rumbled down a runway and into the sky for a test flight that lasted about an hour.

The aircraft landed safely, and Comac, its manufacturer, declared it a success. But the program still has a long journey ahead. It is emblematic of China’s challenge as it seeks to become a leader in aerospace and other critical technologies like electric cars, advanced microchips and artificial intelligence.

The C919 is years — if not decades — behind aircraft made by Airbus and Boeing that are cheaper to fly and easier to maintain. Safety regulators in Europe, the United States and elsewhere still have to certify the plane before it can be sold outside China. And including parts like the engines, its cockpit and its belly, the C919 is filled with gear made by Western industrial giants like General Electric and Honeywell.