MCALLEN—Construction of a private border wall in Texas can proceed, a federal judge ruled Thursday, over the objections of the U.S. government, which fears the project could shift the border itself and imperil a treaty with Mexico.

Fisher Industries, a North Dakota-based construction firm, is funding the estimated $42 million, 3-mile project on private property in South Texas’s Rio Grande Valley.

The project has been on hold since Dec. 5, when U.S. attorneys obtained a temporary restraining order, arguing the that the wall is being built too close to the Rio Grande and could violate a treaty with Mexico by eroding soil and potentially altering the course of the waterway when it floods. Neither the U.S. nor Mexico may alter the river’s course because it is an international border.

U.S. District Judge Randy Crane said the government had not proven the project would cause permanent damage, nor, he said, had the neighboring National Butterfly Center, which separately sued claiming the wall would flood its refuge. The judge declined to continue the restraining order.

Tommy Fisher, president of the company, said crews will begin installing the wall’s panels Sunday and may have the whole 3 miles up within weeks.