HONG KONG — China officially opened the world’s longest sea bridge on Tuesday after China’s leader, Xi Jinping, and local officials inaugurated the 34-mile structure, which crosses the Pearl River Delta to link Hong Kong with Macau and the mainland Chinese city of Zhuhai.

The project, which includes sections of bridge and artificial islands linked by a four-mile tunnel west of Hong Kong’s airport, went billions of dollars over budget and was delayed by two years. Chinese officials expect the bridge to significantly cut driving time between the two sides of the Pearl River, helping to achieve their vision of a Greater Bay Area, as China calls the effort to knit the region’s cities more closely.

Plans for the opening ceremony were announced just days beforehand, apparently timed to coincide with Mr. Xi’s first trip to the southern province of Guangdong in nearly six years. Mr. Xi’s contribution to the opening event, on an artificial island holding Zhuhai’s port facilities, was modest.

[Go deeper: China has built hundreds of dazzling new bridges, including the longest and highest, but many have fostered debt and corruption.]