A roof collapsed at the San Ysidro border crossing between Mexico and the United States on Wednesday, piling debris on lines of cars, injuring at least 17 travelers and construction workers and closing lanes to northbound traffic.

The world's busiest border crossing -- linking Tijuana, Mexico with San Diego, California -- has been undergoing a $600 million upgrade since February that aims to more than double its capacity.

Scaffolding supporting the roof collapsed across several lanes at 10:45 a.m. local time, the U.S. Customs and Border Protection agency said. It was not clear whether the collapse was linked to the expansion work.

CBP officers were processing vehicle traffic in those lanes at the time of collapse, and there were vehicles located under the collapsed area, spokeswoman Jacqueline Wasiluk said in a statement.

Seventeen people were injured, including travelers and construction workers, with most treated on site, she added.

San Diego Fire and Rescue spokesman Maurice Luque said 11 people were being treated in hospital following the collapse, including a pregnant woman and four construction workers, one of whom remained in serious condition.

Three people had to be extracted from crushed vehicles, Luque said, adding that other people in vehicles and pedestrians were also injured.

He said others were treated at the scene but did not require, or refused, additional medical attention.

Following safety checks, authorities reopened the border crossing to pedestrians heading north to California, although the 24 vehicle lanes remained closed.

Northbound travelers were being diverted to the nearby Otay Mesa and Tecate crossings to the east. The San Ysidro southbound crossing to Mexico remained open.